Thread-safetify printf() and allow many arguments

Make printf() thread-safe and provide a non-safe version for ISRs or
emergency cases. Actually, I wasn't able to produce a race condition with my
four test CPUs. I also don't know how qemu works. It seems that it executes
code from all CPUs sequentially in a single thread of its program (just a
guess). However, the locking is clearly needed anyway.

Fix a bug in printf() where it expects that the arguments are below the RIP
which is not the case for the ones passed on stack. The whole argument
handling was rewritten to not pop arguments off the stack but to access them
by index (which has a hole where callee-saved registers and the RIP rest).