Fixes #159. Blocking wait with timeout for checking emails in tests