Fix wait-loop for pending trans (bug 1011338)

Regression from bug 987841
Merge pull request #461 from kumar303/fix-wait

Fix wait-loop for pending trans (bug 1011338)