IO: Add thread safe commandline output

Signed-off-by: Bart Kuivenhoven <bemkuivenhoven@gmail.com>