Fix memory leak closing DIR ccaches

A ccache type's close function is supposed to free the cache container
as well as the type-specific data.  dcc_close was not doing so,
causing a small memory leak each time a ccache is created or
destroyed.

(cherry picked from commit c264c4e824e1abe77806e7bf43ab2641459b7ee9)

ticket: 7574
version_fixed: 1.11.1
status: resolved