Use CloseAfterRead env var to close the file.

In Windows if the program writing logs opens the file with dwShareMode=0
the log writing operation fails. Closing the file after reading allows
the writing process to obtain the exclusive lock.  This also allows for
rolling logs to work in windows since the file lock is released after
each read operation.
Usage:
Windows:  set CloseAfterRead=true
Ruby: ENV["CloseAfterRead"] = "true"
Mac/Linux:  Export CloseAfterRead=true