Pull changes to support round-robin through multiple upstream proxies, and dynamically updatable YAML-based configuration

Helps fix getlantern/lantern#1719
Just for my own understanding, the purpose of this lock is to prevent something else that might modify the config, such as the server sending a new config, from corrupting the iteration. Is that correct?

This is a super quick operation so shouldn't affect performance, but it is happening on every request, so some extra care here is probably warranted. The only alternative I can think of is just creating a copy of the config and not locking, but given that it's so quick it shouldn't matter.