Make manage_agents.exe work on win32

The manage_agents.exe would never change into the proper ossec-agents
directory. There is now some logic added to attempt to chdir() into
the right directory when it starts but it is not foolproof.

Also, corrected the permissions on the client.keys file. They were
not being set properly after the file was written out leaving it
readable to any system user.