Wait for current device scan to finish before starting next one

@kentquirk You had pointed this bug out to me. Want to take a look at this? I just modified the `repeat` function to take an asynchronous function as an argument. Thanks!
The only problem I see is that if you call the stop function during the wait period, it will still call func() one more time. I think that qualifies as surprising and should be fixed.