Add thread syncronization

To each DispatchCommandResult callbackId needs to be passed, so there is no loss of callbacks. When multiple cordova.exec() are called, due to their simultaneously execution error appears - "Failed to locate callback for id". This error is fixed via passing the callbackId and UI behaviour is as expected. Also there needs to be some kind of synchronization between executeSqlBatch and openDatabase, as the first cannot go without the other.