Make test wait for files to close before invoking dx-run-app-locally

While the system waits for files to close before running jobs,
dx-run-app-locally does not.