add LOCK() for proxy related data-structures
- fix #1560 by properly locking proxy related data-structures
- update GetProxy() and introduce GetNameProxy() to be able to use a thread-safe local copy from proxyInfo and nameproxyInfo
- update usage of GetProxy() all over the source to match the new behaviour, as it now fills a full proxyType object
- rename GetNameProxy() into HaveNameProxy() to be more clear