Open files in binary mode to disable text translation

To ensure the correct handling of binary files under Windows, all file
opens now force binary mode.