Fix EZP-21599: content/publish transaction counter error

http://jira.ez.no/browse/EZP-21599

Alternative patch for https://github.com/ezsystems/ezpublish-legacy/pull/766.

Adds an `on-interupt` key for the trigger definition, that accepts as an argument a method definition. The pre_publish trigger in content/publish defines commitTransaction as the callback method, committing the unfinished transaction.

Same description and reproduction steps as https://github.com/ezsystems/ezpublish-legacy/pull/766.

### TODO
- [x] Fix tests
- Revert workarounds introduced for the issue
- [x] https://jira.ez.no/browse/EZP-21563
- [x] https://jira.ez.no/browse/EZP-20558
- Cancel current pull requests with the workaround
- [x] https://jira.ez.no/browse/EZP-21565
- [ ] Extract the bugfix on ezjscore in https://jira.ez.no/browse/EZP-21563.
  Will be replaced by a dedicated one for this particular issue: https://jira.ez.no/browse/EZP-19077.
  *(Can only be done once this PR has been merged)*