Don't assert(...) with side effects
This diffs fixes the assertions introduced in D3232 and adds a linter to
avoid reproducing the issue.
The fix is a backport of core PR14088
The linter is based on the second commit, but integrated into arcanist.
./src/test/test_bitcoin -t scheduler_tests
Revert the changes in scheduler_tests and run:
arc lint -- src/test/scheduler_tests.cpp
The linter should catch the errors
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D3277