fix 2 (possible) memory leaks

Suggestion: add `assert(!pwalletdbEncryption)` before this set