change to how the callback on nrepl close is handled

Before the callback would be called before the server has shut down.