TS-898: fix minor regex_remap parsing bug

If the line contains only whitespace, don't index into the string.

Coverity #1021882
TS-898: avoid passing -1 to close (2) in traffic_cop

This is harmless, but also trivial to fix. Coverity #1021900.