MAINT: Remove uses of the WarningManager class.

WarningManager was a workaround for the lack of the with statement
in Python versions < 2.6. As those versions are no longer supported
it can be removed.

Deprecation notes are added to WarningManager and WarningMessage, but
to avoid a cascade of messages in third party apps, no warnings are
raised at this time, that can be done later.

Closes #3519.
Merge pull request #3520 from charris/replace-warningmanager

Replace use of WarningManager by warnings.catch_warnings and then deprecate it.