Split out of #37344.
Preparation for reuse in systemd-firstboot.
This allows reusing the logic in systemd-firstboot.c. To avoid having to link libxkbcommon into libsystemd-shared, we add a level of indirection to vconsole_convert_to_x11() so that the verify function is passed in by the caller.