Ensures a Closeable object has its close() method called at the end of the supplied block.
any exceptions thrown in the block will propagate through this method.