4229: Get rid of sleep() in test
4229: Add missing Close() calls
Merge branch '4229-close-files' closes #4229