nsqd: empty should clear inflight and deferred

* refactor empty/flush code