Shadow print() and println() with thread-safe variants

Resolves #137.