std: fix an infinite loop in num::ToPrimitive

I accidentally left an infinite loop in a default method in `num::ToPrimitive::to_u64()`. This fixes it.