Fix segfaults when mysql server is not reachable and map is changed/reloaded