Normalize fopen flags

I built it using OSX headers, but Linux has different values for these
constants.