Refactored kernel console code

Rather than entirely separating off output from input, added a new console_t
structure which contains output and input operations structure pointers, and
added main_console and debug_console console_t's. Now both output and input
are tied to one of the consoles.

The getc input operation is now a blocking read (not safe for use in interrupt
context). Non-blocking read is implemented by the new poll operation. This is
used by KDB.

Both of the above are in preparation for the input driver being able to handle
input for the main console (it will take over from the platform code).

Additionally, cleaned up various things and improved locking across the
console and framebuffer code.

Signed-off-by: Alex Smith <alex@alex-smith.me.uk>