Properly mock winreg functions for test

Fixes a lot of test failures on Python 3.4 on Windows, caused by
importlib trying to use our mocked out winreg functions when
reload(path) was called.
Merge pull request #6581 from ipython/mock-winreg-tests

Properly mock winreg functions for test