Create walletdir if datadir doesn't exist and fix tests