Fix some bugs with freeing old config stuff

(This doesn't actually make config reloads work yet, but it's getting
there.)