Only explicitly lock files on non-Windows platforms. 

Windows always locks when the file is opened, and the explicit lock results in a subsequent exception when trying to access the file (see e.g. https://community.oracle.com/message/4634197). Fixes #8.