Use read locks for updating resource variables for POD dtypes unless
Use read locks for updating resource variables for POD dtypes unless
use_locking is set. Previously, the dtype of the first input was
checked which was always DT_RESOURCE, so is_non_pod_dtype was always
set to True.

Reverts changelist 641225077

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/13062 from philipphack:u_fp8_windowed_einsum_xla 3ea415d65e47087bb077fa2b13e34c82a4dae87b
