Fix deadlock in rule triggers.