Avoid slow file output with JRuby/Windows

Replace w+ mode with wb+ mode since it does not replace \n with \r\n, which seems to be really time consuming on big outputs.