Fixed transport close deferring logic.

Transport can still be upgrading after deferring until the drain event.
Merge pull request #352 from rase-/fix/defer-until-drain

Fixed transport close deferring logic.