Fix jsval_to_long for 32bit platform