Use tsort algorithm for sorting -update events after packages installation. Refs #2904