SERVER-9175 Fix overflow in 32 bit builds