wkhtmltoimage: set stdout to binary mode before writing to it on Windows

This fixes #1758 and is essentially porting the fix for issue 61 on
Google Code (48bc4c82eb4b0fc4e78b865a15d957ce59280990).