Ensure the log and pid directories exist

If the directories do not exist the daemon cannot start.