Introduce synchronisation between witness thread and writer thread
These threads were accessing shared data without synchronisation. A mutex was added to synchronise access.
Also add USE_VALGRIND
cmake option that adds extra code annotations for helgrind to reduce false positives reporting. It is OFF by default.
Closes #666
Edited by Krzysztof Leśniak