[PATCH v1 03/11] stdio: Introduce a new helper stdio_file_to_flags()