More reasonable stopServer implementation

This make sure to not progress without actually having stopped the server.