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