xkbcomp/types: fix types being assigned the wrong number of levels in some circumstances