Finalize RemoteFile and RemoteDirectory.