usercertinmem: fix memory leaks