Fix fd leaks when sourcing directory. RHBZ#903833