HER-2065 synchronize on inactiveQueuesByPrecedence inside of synchronize...

...d(WorkQueue), not the other way around, to avoid deadlock