exec: do not save iop->unit if it has not been allocated

This fixes that a file cannot be removed when redirecting output to
it. For examples,

-----
echo hello 3> done >&3
rm done
-----

'done' cannot be removed because it is owned by ksh until ksh quits.

This is observed when executing 'git rebase -i'.

    modified:   exec.c
sh: support 'local'

Add 'local' as a built-in alias in sh as well as in ksh.

    modified:   main.c