Fixing missing close method invocation when using DirectoryStream