This pull request it's to solve the issue OHAI-390

Move the chdir to inside the fork and refactored run_command_unix and run_command_windows to pass tempdir