So either the way the encoded-kbd map is set up prevents garbage-collection from working (e.g., it might set up some kind of circular structure), or there is a bug that prevents us from freeing keymaps associated with deleted keyboards.