wait_file blocks until file has contents