common: Fix JSON skipping when string ends after escape

Fixes #754
Closes #756
Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>