locking semantics for cout

quick and dirty RAII locking semantics for cout and corresponding
convenience macros.  State changes via manipulators made by a thread
while locked are undone at lock release to keep iomanip behavior
consistent under concurrency.