[clang][Checkers] Fix PthreadLockChecker state cleanup at dead symbol.

It is possible that an entry in 'DestroyRetVal' lives longer
than an entry in 'LockMap' if not removed at checkDeadSymbols.
The added test case demonstrates this.

Reviewed By: NoQ

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

GitOrigin-RevId: bee4813789a378584d43c65497a5efd2353a6606
2 files changed