Fixed stack overflow in Fdb.GetMaxSafeApiVersion()