Trying to disable a wallet flag with setwalletflag results in Internal bug detected: 'std::any_of(m_results.m_results.begin(), m_results.m_results.end(), [ret](const RPCResult& res) { return res.MatchesType(ret); })'. This occurs because the warnings field was not marked as optional. This PR makes warnings optional to avoid this error.
Also added a test case because apparently we didn't already have one.