base64: fix signed overflow in shift