Close db when needed for windows
Use O_BINARY when opening data file on windows

Otherwise any newline chars that happen to be in the
file will be helpfully interpreted by windows and replaced
with CLRF which will cause the loading process to fail (as
expected).