Fix bug: sometimes stream has been closed but paired stream is still alive.