fix multi-threaded FMDB usage with FMDatabaseQueue

FMDB has its own multi-threaded supported through FMDatabaseQueue so I have adapted the existing code to use that rather than dispatch_asyncs and so on.

The original code was causing odd behaviour with my app due to a single FMDatabase instance being shared between multiple calling threads. The enclosed pull-request fixes this issue by using the FMDB built in multi-threaded support and block callbacks from inDatabase and inTransaction