Allow wait_for to wait on non-traditional files

Use os.path.exists to check for file existence, instead of "can we open
this file for reading".

Fixes #6710
Fail fast in the presence of permissions issues
Merge pull request #7374 from hfinucane/wait_for_pipes

Allow wait_for to wait on non-traditional files