x11: add 0 < ctrls->numGroups <= 4 assertion

This only happens if something is wrong in the server; a valid keymap
cannot be had in any case.

Signed-off-by: Ran Benita <ran234@gmail.com>
state: check wrap_group_into_range() return value

It returns XKB_LAYOUT_INVALID in case num_groups == 0. So we shouldn't
just save it in the state.
Note, though, that this condition is generally impossible.

Signed-off-by: Ran Benita <ran234@gmail.com>
doc: move some file comments into txt files in doc/

Signed-off-by: Ran Benita <ran234@gmail.com>