[mlir] Add elementAttr to TypedArrayAttrBase.
In code generators, one can automate the translation of typed ArrayAttrs
if element attribute translators are already implemented. However, the
type of the element attribute is lost at the construction of
TypedArrayAttrBase. With this change one can inspect the element type
and generate the translation logic automatically, which will reduce the
Differential Revision: https://reviews.llvm.org/D73579