Improve cscope export in the face of bad UTF

If we can't manipulate the line because of bad characters, don't try.
Use the length of the string in bytes for the header, not the length in
characters; real cscope doesn't like multi-byte characters.