cStringIO does not get it right (reported as SF bug #115531). Added test for ValueError when write() is called on a closed StringIO object. Commented out because cStringIO does not get it right (reported as SF bug #115530).