[electrum] cache scriptsig for complete inputs, invalidate it for incomplete inputs
Summary:
When computing the scriptsig, cache it if the input is fully signed. If the input is incomplete, don't return the cached scriptsig in get_or_build_scriptsig as it could have change if the signatures are updated.
Use the built scriptsig also for equality comparison and hashing. I missed this in D14493, and it is important when comparing inputs that don't yet have a scriptsig or have just been updated (signatures added).
Test Plan: python test_runner.py
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D14500