[OpenMP][FIX] Do not dereference a potential nullptr

The first thread state in the new GPU runtime doesn't have a previous
one and we should not dereference the nullptr placeholder.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D111946

GitOrigin-RevId: dc72960967d7a440d0dfd30bbc70e4131ca5e239
1 file changed