[GDBJIT] Make gdbjit thread-safe & bug fix (dotnet/coreclr#14390)
* [GDBJIT] Fix DW_AT_comp_dir setting
We should use cuPath to set dirPath in NotifyGdb::EmitDebugInfo instead of
DebugString[1].
* [GDBJIT] Make gdbjit thread-safe
NotifyGdb::MethodPrepared method can be called from multiple threads
simultaneously in this case gdbjit will work incorrectly as it uses
global variable without synchronization.
Commit migrated from https://github.com/dotnet/coreclr/commit/
0ba964d19b84a690a451a61a38fa12c4ebf4f890