[mlir][spirv] Rework type size calculation (#160162)
Similar to `::getExtensions` and `::getCapabilities`, introduce a single
entry point for type size calculation.
Also fix potential infinite recursion with `StructType`s (even
non-recursive structs), although I don't know to write a test for this
without using C++. This is mostly an NFC modulo this potential bug fix.