Fixes uninitialized data in tmp filename
The filename string used for the detector's temporary file had an
uninitialized byte at its end. Usually this byte is 0, so it has no ill
effect. Occasionally it can be a garbage byte, which can cause the
temporary file write() to fail.
Because Ohcount had been failing to check write()'s return value, these
errors went unnoticed, and incorrect line counts were silently returned.
I have fixed the uninitialized byte, and the previous commit adds
the appropriate error checks.
All code counted prior to this fix should be recounted.