Make sure that initial state gets reset if anything goes wrong in ``rc_context``

Fixed a bug that caused rc parameters to not be reset to initial state if an exception happened while setting new rc parameters inside rc_context. This matters because I use ``rc_context`` is a testing suite and one of my tests may *want* ``rc_context`` to fail, but then the rcparams are left in a modified state for future tests. I have included a regression test.

Unfortunately I have to use an ordered dict otherwise the failure is not deterministic (because it depends on the order in which the rcparams are set) so if ordered dict can't import I simply pass the test (I wasn't sure if you make use of the skipping plugin).
Technically speaking, wouldn't this still leave new entries in the dictionary? Of course, this might not matter if the set of entries is always the same. Still I would have hoped that there would be a context manager for something like this already. If there isn't, it feels like a hole in the standard library.