Avoid triggering undefined behaviour (std::memset(nullptr, 0, 0)) if an invalid string is passed to DecodeSecret(...).
Backport of Bitcoin Core PR14242
https://github.com/bitcoin/bitcoin/pull/14242