Fix bug in Semaphore on Windows.

A maximum value of 65535 wasn't sufficient for rendering high-resolution
images.

See also http://pageant.ghulbus.eu/?p=689.