Test broke because close of connection happened before finished writing and the callback crashed.