Well, he could have walked away any time.
Moral:
Be polite to the cops and get rid as soon as possible. Loud arguing and protesting innocence will do no good.
That said the cops seem to have over reacted a fair bit for an innocuous remark. In full "Nick Mode".