[flang][OpenMP]Replace assert with if-condition (#139559)
If a symbol is not declared, check-omp-structure hits an assert. It
should be safe to treat undeclared symbols as "not from a block", as
they would have to be declared to be in a block...
Adding simple test to confirm it gives error messages, not crashing.
This should fix issue #131655 (there is already a check for symbol being
not null in the code identified in the ticket).