Check for readable install dir in init.d scripts

Install directories for Qserv and its dependendencies
are used in some init.d scripts. The check function
has been rewritten w.r.t. POSIX standards.