Add command -v builtin.
Fix builtins I/O redirections

A out-of-bounds array access has been introduced in
fed10750771c5b061a80a9cb04e6a0de2405484c.
Flush stdout/stderr after executing builtins

When stdout/stderr are set to a pipe, they're not flushed on newlines. This can
result in out-of-order output. For instance:

    command ls
    echo middle
    command ll

Since echo flushes its output before exiting, the output of the first builtin
call will appear after echo's.

The solution is to flush stdout/stderr after builtins have been executed.

dash does the same thing.
Improve docs
Remove job_{terminated,stopped}, superseded by job_poll
Fix executing multiple commands at once in an interactive shell
Restore signal handlers in subshells
builtin/fg: move background jobs, not stopped jobs

From the POSIX spec:

> the fg utility shall move a background job from the current environment into
> the foreground
Create a job when executing a subshell
Introduce job_poll
Improve docs
Only create jobs if job control is enabled
builtin: add bg
builtin: add fg
Handle stopped jobs
Introduce job_set_foreground
job_finished → job_terminated
Put jobs in the foreground
Fix signalled process exit code, finished → terminated
Add context.background
Next