Use another LOCK for g_prgname to avoid deadlocking. (#62606)