log: lock mutex when printing to avoid race conditions on thead init
waf: update compile flags to be more strict
Fix gcc warnings after updating C dialect and compiler flags