[PATCH v1 04/11] console: Switch to use stdio_file_to_flags()