fixed a crash if the log path was empty
moved fix for crash if log path was empty to the watcher thread wrapper, fixed posible recource leaks at dir watcher
fixed missing closehandle