What's your OS?
I use keyboard mode all the time and do a lot of alt-tabbing, but I've never had it lock the mouse on me. (I'm on Win7.)
We can resolve this by, as you say, manually making sure the mouse is unlocked on focus switch. Though focus detection in Windows is actually not all that straightforward, so we'll see how well it works... (this is why I didn't implement caps lock detection for text entry, as well--it doesn't play nice with alt-tabbing+SDL, the engine Cogmind runs on).