IDEA-103406 Folding: Correct processing for multi-root files

Checking not only base psi file
in case of errors do not perform differentiate operation in 'rebuild' mode
use correct qualifier class