Add tests for embedding text in JSON reports with the java lib

Add tests to expose that the java JSONFormatter does not handle calls
to write() correctly. The formatter expects them after the result()
call, but if a step definition uses write() calls to embed text in the
report, they will occur after the match() call but before the result()
call.
Fix the java JSONFormatter to handle calls to write() correctly

Fix the java JSONFormatter so that it can handle calls to write() after
the call to match() but before the call to result().
Merge branch 'json-formatter-write' of github.com:brasmusson/gherkin
Attribution. Closes #269.