Clean up work/log/pid dir implementations and fix Windows build.
Merge pull request #1018 from kacfengine/master

Clean up work/log/pid dir implementations and fix Windows build.