Add timeout in wait helpers

@jzoldak