Test case for write after connectionLost.