This PR improves the worst-case behavior of CScript::FindAndDelete.
I have emphasized the obvious correctness of the algorithm in this commit.
Additionally I have done extensive fuzzing to ensure the result is identical to the current implementation.