GCS MapLib:DB cache, made sure all queries are out of context

before calling removeDatabase
Merge pull request #1032 from guilhermito/map_db_fix

GCS MapLib, fix database disconnection upon creation