Make the listenAndDispatch goroutine exit when the EventMonitor is closed