Pad thread ID in log header to 7 spaces, to match C++ format. Add check in TestHeader to detect padding mismatch.