Fix lessinput.sh detection in custom PATH

The detection of lessinput.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.