Fix auto_increment retrieval with MySQL
This caused a lot of problems if you have more than one market tables in
the same MySQL instance
A little bit of cleanup
Stop DB queue if it has been disconnected
globalmarket.noqueue should override group limits