Simplify "!foo || (foo && bar)" as "!foo || bar"
Summary: Backport of core PR10780
Test Plan:
make check
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Subscribers: teamcity, schancel
Differential Revision: https://reviews.bitcoinabc.org/D2198