Let the Java JSONFormatter record before hooks in next scenario

To work with Cucumber-JVM, let the Java JSONFormatter record before
hooks in the scenario for which scenario() is called next.
Cucumber-JVM calls before hooks before scenario() (or background()) is
called on the JSONFormatter, Cucumber-Ruby calls before hooks after
scenario() (or background()) is called on the JSONFormatter. The JSON
parser spec need to be relaxed to work with both the Ruby JSONFormatter
and the Java JSONFormatter.