Stopping io polling before emitting close event