Ensure delimiting quark is present for all loop breaks

The quark s removed by the end-test, so needs to be re-inserted to
stick with just one escape function. At the same time, clear all of
the storage to avoid any edge cases.