Close mongodb connections.