wallet: Fix non-determinism in ParseHDKeypath(...). Avoid using an uninitialized variable in path calculation.
Summary:
- wallet: Add error handling. Check return value of ParseUInt32(...) in ParseHDKeypath(...).
- wallet: Add tests for ParseHDKeypath(...)
This is a backport of Core PR13712
Test Plan:
make check
Reviewers: #bitcoin_abc, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D4500