Make DirectoryStream AutoClosable and use try-with-resource

Also fixes a leak in RemoetNameSpaceProvider.

Target: trunk
Require-trunk: no
Require-book: no
Acked-by: Paul Millar <paul.millar@desy.de>
Acked-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Patch: http://rb.dcache.org/r/6119/