Clean up whitespace.
Don't lock stream during format().

This shouldn't be necessary when the application is locking correctly.
Don't lock in print().

The application should be handling this as well if the stream is
shared between threads.