I don't understand why you are locking around msWMSGetCapabilities ... is msWMSGetCapabilities itself not thread safe ? From your comment I had understood that msLoadProjectionStringEPSG was the unsafe call, so would be expecting to find the lock in there.