Respect io parameter to writemime. (Fixes #172)