This is a very simple pull requests that removes the global pwalletMain pointer and replaces the calls with CWallets::defaultWallet().
This PR leverages the internal global single wallet container to a vector. We have similar functionality on the Qt layer.
This will allow a step-by-step transition towards multiwallet support like proposed by @luke-jr in #8694.