Fix file handle/line ending issues so that tests pass on Windows (rebased onto dev_5_0)



This is the same as gh-1057 but rebased onto dev_5_0.

----

Running ```ant clean jars test``` on Windows should now pass; without these changes, there would have been a handful of failures in the ```formats-gpl``` and ```formats-common``` components.  Once merged, this should be a step towards making ```BIOFORMATS-5.1-latest-win``` green.

/cc @rleigh-dundee