minor fixes to wait_for to avoid tracebacks

 as per ansible core issue https://github.com/ansible/ansible/issues/9244