wallet: shuffle coins before grouping, where warranted
Summary:
Issue brought up in https://github.com/bitcoin/bitcoin/pull/12257\#discussion_r204554549
This is a bacport of Core PR13808
Test Plan:
make check
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D3414