Jit64: implement tw/twi more accurately

Fixes issue 7253.
Merge pull request #335 from Tilka/twx

Jit64: implement tw/twi more accurately