[mypyc] Infer more precise error kinds for some ops (#13524)
During the error handling transform we have access to always
defined attributes, which allows us to infer that certain
attribute operations will never fail.
This can improve performance and reduce the size of the generated
code.