Fix a possible segfault when parsing JSON containing very large strings
Summary: Taken from https://github.com/Seldaek/jsonlint/commit/a3844d460bbbbcfa69550a98c675ea6358253451.
Test Plan: Ported the test case from https://github.com/Seldaek/jsonlint/issues/25.
Reviewers: epriestley, Blessed Reviewers
Reviewed By: epriestley, Blessed Reviewers
Subscribers: Korvin, epriestley
Differential Revision: https://secure.phabricator.com/D11323