Atomic-orbital-based approximate self-interaction correction scheme for molecules and solids