Bug/4573 close always returns

@karlj-spindance @raensink please review.

Pull with lwipdemo.
What's this (err)?