Use 'y#' instead of 's#' in write_rgba of the agg backend. Fixes #1891.
Prevent mpl_PyFile_Dup from failing when given BytesIO or similar