1384 fix db.sync cancel function

With this change, I have 0 test failures again, in node and browser.