Additional sanity checks for configs

Added a check in Config.__exit__ to ensure that we don't
pop the default config off of the stack.
Also added a check in Network.__exit__ to ensure that
the config being popped is the network's config.

Since configs have their own stack, this means that things
get kind of dicey if we change the network's config;
that new config doesn't get added Config.context,
and the old config remains.