Fixed #19373 -- Ported Windows file locking from PyWin32 to ctypes

Currently, no file locking happens on Windows unless `PyWin32` happens to be installed. This removes that (undocumented) dependency by using `ctypes` instead. Adapted from Anatoly Techtonik's port for Roundup.

The tests are passing for me on Windows (Python 2.7.5 and Python 3.3.2) and linux (Python 2.7.2).