Encode the given messages as a SockJS message frame. Aside from applying standard
JSON quoting to each message, there are some additional JSON Unicode escaping
rules. See the "JSON Unicode Encoding" section of SockJS protocol (i.e. the
protocol test suite).