Fixes#7649.
emit_keystroke code path in kmx processor was writing directly to the
core queue instead of to the internal kmx processor queue. This caused
it to be out-of-order in the actions sent to the engine/debugger.
Engines didn't really care but it broke the debugger, for example if
only a deadkey was in the buffer and backspace was pressed, Developer
would assert as it would get unexpected context for the deletions.
Fixes#7643.
The kmn statement `save()` action was being written directly to the
state queue, bypassing the internal kmx action queue. This caused two
issues:
1. save() actions were out-of-order with other actions on the same key
event.
2. The number of items in the internal action queue became out of sync
with the debug item queue, which would cause the debugger to fail
with an assertion.
The new test in debug_api.cpp validates this second issue as the number
of items in the action queue now matches the expected count in the
corresponding debug item.
The name json.hpp conflicts with the JSON for Modern C++ library that
is also used by Developer. Renames json.hpp and json.cpp to jsonpp.hpp
and jsonpp.cpp aka "JSON Pretty Printer".