[Libvir] detect overflow in string-to-int conversion