Encapsulate code that uses wallet with #ifdef ENABLE_WALLET

This compiles and works with with --disable-wallet (or --without-wallet).