Change sleep method to wait in 'setup_environment'

Changed simple sleep timeout to wait.

Change-Id: I3c95490fdd425b409292ce9550d3817d22c2caca
Closes-Bug: #1319071
(cherry picked from commit d821b6db1d82094021a084f7c04bf5a81dcbb75c)
Merge "Change sleep method to wait in 'setup_environment'" into stable/5.0