main/framebuffer: refactor _mesa_get_color_read_format/type