File Open modes: Use an real enum instead of const values

This will also silence compiler warnings about sign mismatches