Fixes issue #408: Mongoose server not killed properly