Fix `plenv()` function in ksh and dash.

dash doesn't support `typeset`.  Use `local` instead.

This commit is inspired by sstephenson/rbenv@5ae2cac088d12fea01054e1f3abbf304b92920b5 .
Merge pull request #56 from dochang/shell-fixes

Fix `plenv()` function in ksh and dash.
bail out early if readlink is not available

readlink comes from GNU coreutils.  On systems without it, rbenv used to
spin out of control when it didn't have readlink or greadlink available
because it would re-exec the frontend script over and over instead of
the worker script in libexec.

Ref. #58
https://github.com/sstephenson/rbenv/commit/81bb14e181c556e599e20ca6fdc86fdb690b8995
https://github.com/sstephenson/rbenv/issues/389