BUG: Fix to_json lines with escaped characters
Updates existing to_json methodology by adding is_escaping variable,
which ensures escaped chars are handled correctly.

Bug description: A simple check of whether the prior char is a backslash
is insufficient because the backslash may itself be escaped.

A test is also included (previously included in #14693).

xref #14693
xref #15096

 - [x] closes #15096 (#14693 was previously closed by author)
 - [x] tests added / passed
 - [x] passes ``git diff upstream/master | flake8 --diff`` (used ``pep8radius master --diff`` instead)
 - [x] whatsnew entry (does not seem necessary, but let me know if I should add)
