Fix p2 variable scopes in xkbevents handler

As they are defined in their case labels, they go out of scope before being
used by hook_call_p().