inference: incorporate stackoverflow possibility into exc type modeling (#52268)
Currently `exc_bestguess` does not take into account the possibility of
stackoverflow error, causing the inconsistency between exception type
modeling and `:nothrow` modeling. This commit fixes it up.