Add waitForActivityStackToBeEmpty method

Enables the test to wait for all activities to finish