Fix for double invoked callbacks on database.executeSql

Sorry this has taken so long - the fix was easy, but I've just given up trying to get the source into the right branch.  Having started in the wrong place, if you'll be manually performing the merge anyway, here are the changes as if for master.