Replace non-portable `typeset` with `local`.

Dash doesn't recognize `typeset`.  To declare a local variable, use
`local` instead.