fix 2 (possible) memory leaks

In this case yes just do it after all `delete pwalletdbEncryption` calls (except where it already happens).