It seems the logging output from the code I pasted tricked me into thinking that the transaction was aborted, since the transaction.onerror handler was called. What I did not log, though, was whether transaction.onabort was called ... It turned out that a call to event.preventDefault actually was enough!
What confused me was that the error propagated up to the transaction error handler. The transaction was not aborted, though!. It just bubbled up the event after preventing the default action (aborting). To get rid of the message I also need to call event.stopPropagation in order to prevent the event from bubbling up to the transaction's error handler. Note that this is not strictly necessary if you just need the transaction to not be cancelled.
I found the answer by digging around in the W3C docs on IDBRequst and IBTransaction.