flock in logMsg and a few fixes in harness tests
A few missing unlock for writes, inside a macro
Merge pull request #325 from telefonicaid/hardening/harness_fixes

Hardening/harness fixes