Move syslog initialization after closing all file descriptors and add some error messages about lock file

Fixes #6