Fix parsing of "-I foo" and "-L foo" under superenv

Fixes #24654.