Solve issue with concurrent calls to cordova.exec