bugfix: always acquire TVAR locks in the same order - actually only "almost" fixed: TVARs are sorted by their hash code (sxhash obj), then locked
bugfix: always release TVAR locks in opposite order from acquisition
enhancement: allow functions registered with (before-commit) and (after-commit) to also call (before-commit) or (after-commit) while they execute