[flang] Extend assumed-size array checking in intrinsic functions (#139339)
The array argument of a reference to the intrinsic functions SHAPE can't
be assumed-size; and for SIZE and UBOUND, it can be assumed-size only if
DIM= is present. The checks for thes restrictions don't allow for host
association, or for associate entities (ASSOCIATE, SELECT TYPE) that are
variables.
Fixes https://github.com/llvm/llvm-project/issues/138926.