Oh, this is my fault: it was supposed to remove setpwalletRegistered and its critical section, but apparently didn't. In any case, they're obsolete now, and that can remove the dependency on CWallet.