Prevent mpl_PyFile_Dup from failing when given BytesIO or similar