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

This will also silence compiler warnings about sign mismatches