Switch to a static local variable to avoid global constexpr warning (#14638)
### Description
Switch to a static local variable to fix the warning
Comments in the code so it's clear that it's intentional.
### Motivation and Context
Prefast warning: [prefast:Warning]: C26426 (in
'onnxruntime::cuda::`dynamic initializer for 'castOpTypeConstraints''')
Global initializer calls a non-constexpr function
'onnxruntime::DataTypeImpl::GetTensorType<onnxruntime::MLFloat16>'
(i.22).