Update PullApiTestConsecutivePushesGetQueued test to be more resilient to github flakiness.

For that refactored the retry code, also updated this and one other tests to async / await code.
Also added an assert for exceptions that can handle async code.