Fix ccm_memory() cleaning user-supplied key (cherry picked from commit 85ac227862eceb3b22c0852a7dc363d46c2dd532)