Fix a null pointer dereference in validateaddress with -disablewallet. Also add a regression testcase.