[OPENMP]Fix PR41826: symbols visibility in device code.
Currently, we ignore all locality attributes/info when building for
the device and thus all symblos are externally visible and can be
preemted at the runtime. It may lead to incorrect results. We need to
follow the same logic, compiler uses for static/pie builds. But in some
cases changing of dso locality may lead to problems with codegen, so
instead mark external symbols as hidden instead in the device code.
Subscribers: guansong, caomhin, kkwli0, cfe-commits
Differential Revision: https://reviews.llvm.org/D70549