RemoveStageBarrier: add temp test code to detect deadlock