Reset warnings and sys modules completely before and after logging tests to avoid side effects.
Merge pull request #1750 from astrofrog/fix-logging-tests-side-effects

TestComparisonUfuncs.test_comparison_valid_units failing with Numpy 1.8.0 and Numpy dev