Fix lesspipe.sh detection in custom PATH

The detection of lesspipe.sh has to be done after setting PATH as it
could be installed in a non-standard bin directory. For example,
Homebrew installs lesspipe in /usr/local.