plugins/bf4: fix JSON encoding.
plugins/bf4: fix JSON encoding.

The previous code accidently used the
C-string "host" and "serverID" variables
in the JSON output for the context and
identity.

To avoid too many changes, this commit
changes the JSON escape function to
work on C strings instead, and uses
that to escape the "host" and "serverID"
strings from the game before emitting
them into the JSON documents.

This commit also adds some extra code
to ensure that the game strings we
include in the JSON document are
within the printable ASCII range.

SuperNascher/mumble,SuperNascher/mumble,LuAPi/mumble,LuAPi/mumble,LuAPi/mumble,Lartza/mumble,Lartza/mumble,LuAPi/mumble,SuperNascher/mumble,LuAPi/mumble,LuAPi/mumble,SuperNascher/mumble,SuperNascher/mumble,Lartza/mumble,SuperNascher/mumble,LuAPi/mumble,SuperNascher/mumble,Lartza/mumble,Lartza/mumble,Lartza/mumble,SuperNascher/mumble,LuAPi/mumble,Lartza/mumble,SuperNascher/mumble,LuAPi/mumble,Lartza/mumble