Fixed read of the jpg in Windows

Windows needs to open things with _O_BINARY

Signed-off-by: Michel Archambault <marchamb@matrox.com>
replaced last remaining close on wsi->sock with compatible_close

Signed-off-by: Tobias Maier <tobias.maier@netplace.com>