Persist a checksum and close the file.

def close(self):
        """Persist a checksum and close the file."""
        fname = os.path.basename(self._path)
        checksum_persister = _get_checksum_persister(self._path)
        with contextlib.closing(checksum_persister):
            checksum_persister[fname] = self._hasher.hexdigest()

        self._close()