Check for OOM during json decoding

Summary: json parsing can create massively big objects from relatively small
strings, so check for OOM during parsing.

Reviewed By: @markw65

Differential Revision: D1516420