stdmem: free: only call _gcry_secmem_free if needed