thread lock for syslog and console writing