IO#syswrite should raise an error if it's not opened for writing.