Handle file creation and locking for Windows

Due to the use of the 'defer' keyword, file handles were kept open too long. This resulted in the error 'The process cannot access the file because it is being used by another process.'.

Another addition is for opening the file .logstash-forwarder. Initially this file will not exist. The Registar for Windows assumes this file exists. Therefore we explicitly tell the OS to create the file when it doesn't exist yet.

See also https://groups.google.com/forum/#!topic/logstash-users/oFDcoGj8Qtc