posix/shell: add per thread STDIO

**WIP**

This PR is intended to make shells / terminals much easier to implement.

Each thread can override the default STDIO handler. A new thread inherits the STDIO handler from its parent.