Eliminate ineffective uses of "dx select" in tests

Summary:
run('dx select PROJ_ID') in tests didn't actually change the project in a way
that is visible to subsequent subprocess calls. That's because the setUp method
of DXTestCase, used by most of our tests, creates a temporary project and sets
DX_PROJECT_CONTEXT_ID to its id, thereby shadowing the project context in the
session config files that was written by 'dx select'.

This change introduces a context manager select_project that overrides
DX_PROJECT_CONTEXT_ID in the same way that DXTestCase.setUp does (and restores
the old value when it's finished).

Test Plan:
Added a new test for select_project. Moreover, since we had some tests that
succeeded despite 'dx select' not doing the right thing, I verified that this
test fails when the implementation of select_project is just replaced with the
naive call to run('dx select PROJ_ID').

Reviewers: klai

Reviewed By: klai

Subscribers: pnguyen

Differential Revision: https://phabricator.dnanexus.com/D122