mathops: remove undefined behaviour from sign_extend()

This function intentionally overflows the signed range on
the left shift.  Using this type-punning avoids errors from
the overflow checker without disabling this test globally.

Signed-off-by: Mans Rullgard <mans@mansr.com>
