Ensure write pumps return when socket is closed