Redefine mark, reset, unmark, ismarked for IO only

* This is slightly sketchy, as it assumes that IO.mark exists, but
  is perhaps better than duplicating the code for all subtypes.