Implement missing xkb_state_ref and add return value