Fix compilation (on Cygwin), by adding the necessary includes.

No idea why this problem has not shown up on other platforms; the includes are by no means Cygwin-specific.