Protect JSON decoding

Wrap JSON decoding inside an eval to catch any decoding errors, which are
now emitted as an event.

Stops the stream dying if there's some error and provides a way for upstream to detect the errors.