Switch back to last used layout from "special" layouts
When the input purpose doesn't trigger a "special" layout like "terminal" we want to switch back to the last language layout on the next purpose change. This patch does that. Marked as draft as it's on top of !57 (merged) . I've not included it there as it's easier to test separately and it will likely not make it into 0.24.0.