Don't possibly dereference bad signatures in OP_CHECKMULTISIG.

We do all the preprocessing in one loop. Fixes a bug introduced a while ago to
handle invalid signatures. Found by more tests from bitcoind.
Make removeOpcodeByData in line with bitcoind behaviour.

It should remove the opcode and data is the data is contained within the data
pushed, not just if it is equal to it. Found by bitcoind tx tests.