Sleep to avoid non-determinism due to Darwin's poor mtime resolution. Fixes #16855. (cherry picked from commit b90437d8)