move the file system helpers in their own file
Fix the logs in the update phase

Since csync use a thread local variable for the logs, we need
to reset it when we enter the update thread