Variational pseudo-self-interaction-corrected density functional approach to the ab initio description of correlated solids and molecules