Conditionalize triggers (prevents unnecessary scheduler<->resolver locking)
Scheduler locks package row as a result of the trigger being run and then tries
to update depchanges. Resolver also did both, but in reversed order, so it was
likely to deadlock. Previous commit ruled out the deadlock by reversing the
order, but it still held the lock on package for quite long time. Now scheduler
shouldn't lock package rows, unless the package is being marked as ignored.