Added synchronization support to streambuf_bsd.

Also added locking and wiping to the formatted input/output operators.
Still need to finish the logic for splitting the peer threads out.