Fix 'shortest possible pushdata' logic for transaction inputs. Also add a testcase.