Prevent asInt() from modifying stack data.

The stack data is normally sliced from the actual script and btcscript is not
supposed to ever change the tx passed into it.

Add a test (and fix the other leading zeros tests) to stop this happening again.