Fix: safe proxies reading

Set up `proxies` safely for the `.setdefault()` call a few lines below by coercing it into a dict if passed in as `None`, and adjust the one line that was potentially expecting a `None`.

Hi @bradsbrown it sounds like you ran into a bug that you're trying to fix here. Could you share the code you used to encounter it and what the stack trace was?

@sigmavirus24 Absolutely! Meant to add this last night, and got pulled away. Here's what triggered this for me - I was running some work that relies on `python-jenkins`, and that library calls out to `requests` with a call to `merge_environment_settings` that hard-codes `None` as the value for `proxies`. Here's what I kept running into on that call:

```
Traceback (most recent call last):
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/bin/jenkins-jobs", line 11, in <module>
    sys.exit(main())
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/cli/entry.py", line 146, in main
    jjb.execute()
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/cli/entry.py", line 140, in execute
    ext.obj.execute(self.options, self.jjb_config)
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/cli/subcommand/update.py", line 148, in execute
    n = builder.delete_old_managed(keep=keep_jobs)
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/builder.py", line 187, in delete_old_managed
    jobs = self.get_jobs()
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/builder.py", line 168, in get_jobs
    return self.jobs
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins_jobs/builder.py", line 96, in jobs
    self._jobs = self.jenkins.get_all_jobs()
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py", line 951, in get_all_jobs
    jobs = [(0, "", self.get_info(query=JOBS_QUERY)['jobs'])]
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py", line 694, in get_info
    requests.Request('GET', self._build_url(INFO))
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py", line 533, in jenkins_open
    return self.jenkins_request(req, add_crumb, resolve_auth).text
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py", line 549, in jenkins_request
    self.maybe_add_crumb(req)
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py", line 347, in maybe_add_crumb
    'GET', self._build_url(CRUMB_URL)), add_crumb=False)
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py", line 533, in jenkins_open
    return self.jenkins_request(req, add_crumb, resolve_auth).text
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py", line 552, in jenkins_request
    self._request(req))
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py", line 524, in _request
    r.url, None, None, self._session.verify, None)
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/jenkins/__init__.py", line 278, in merge_environment_settings
    **kwargs)
  File "/var/lib/jenkins/shiningpanda/jobs/b14abac8/virtualenvs/d41d8cd9/lib/python3.5/site-packages/requests/sessions.py", line 674, in merge_environment_settings
    proxies.setdefault(k, v)
AttributeError: 'NoneType' object has no attribute 'setdefault'
Build step 'Virtualenv Builder' marked build as failure
```

I did some digging into the `requests.sessions` code and found that we assume `proxies` is a dict [right here](https://github.com/requests/requests/blob/master/requests/sessions.py#L679) despite treating as though a value of `None` is possible [just a few lines above](https://github.com/requests/requests/blob/master/requests/sessions.py#L676).

This PR is an attempt to safeguard against that error by coercing a `proxies=None` into an empty dict, which looks to play nicely with the usage of `proxies` throughout the rest of the function.

Side note: I'm also working on a PR to `python-jenkins` to pass in an empty dict instead of `None`, so that hard-coding a value at least uses one that is more reasonable.

Hey @bradsbrown, to follow up, we probably don't want to unconditionally set proxies to a dict because it triggers extra code paths we don't want in the common case. Specifically in `merge_settings` and `should_bypass_proxies`.

That said, I do agree there is a gap here. We have a more elegant fix for this in the 3.0.0 branch (#2839), but that is slow moving at the moment. If we want to solve for the current issue, we may want to set `proxy` to `{}` just before the loop, but only if `env_proxies` is set and `proxy` is None. I'd like @sigmavirus24 to chime in before we make any changes, but that's the only solution I see at the moment that won't create a cascade of possibly breaking changes elsewhere.

Resolving this as we have the longer term fix available in the next major version. I think it’s unlikely we’ll introduce the partial fix in the short term due to the side effects.