Revert "only listen to close event once"

This reverts commit b37990d327bc9661e0e5fa1ff92ecbf6703fbe14.

Conflicts:
	lib/middleware.js