[mlir] Add workaround for false positive in -Wfree-nonheap-object
Restore 499571ea
reverted by 00827646.
A compiler slightly older than
"[clang][Sema] removes -Wfree-nonheap-object reference param false positive"
may report the false positive.
We need to retain the workaround a bit longer so that such compilers
can be used to compile MLIR in a warning-free way.