Fix the resolve algorithm according to [JEP 406](https://openjdk.java.net/jeps/406). It includes:
- The correct resolution of variables in pattern matching guards in both if and switch
- Restricting the maximal scope of resolving by the PsiSwitchLabeledRuleStatement
- Various tests for resolving variable in pattern matching for switch
Signed-off-by: Nikita Eshkeev <nikita.eshkeev@jetbrains.com>
GitOrigin-RevId: 1efb10f50a458a382a71ffeaef5a0f540b4a8893