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.
Fix plenv version command to output the currently correct version

Hopefully no-one forgets to update this when v2.1.2 is released!
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
add autocompletion file for fish shell
Merge pull request #59 from exzz/fish

add autocompletion file for fish shell
Merge pull request #57 from LoonyPandora/master

Fix plenv version command to output the currently correct version
Improve shell detection.

* This code change copied over from rbenv-init
Merge pull request #62 from finn/master

Improve shell detection.