Add test for write in closed transport