BUG: compat_pickle should not modify global namespace
Merge pull request #5661 from jreback/pickle_fix

BUG: compat_pickle should not modify global namespace