BUG: use unittest.mock for Python 3.3+

Some tests had unguarded import of 'mock', but 'mock' package not
installed for Python 3.3+; change to use 'unittest.mock'.
Merge pull request #3189 from matthew-brett/use-unittest-mock

BUG: use unittest.mock for Python 3.3+