Do not assume that stdin is a tty

This can be used from another non interactive software, see #9695
for details.
Use --version to see if less can be executed

(less) 2> /dev/null would fail if stdin is /dev/null.
Sinceless --version do not read anything from stdin,
it is perfect for seeing if the software exist or not.

Also replace the whole os system detection by directly
using subprocess ( as we use it elsewhere, we already
depend on it ).
Merge pull request #9809 from mscherer/fix_9695

Make sure ansible-doc work when stdin is not a tty