goad std::ostream into throwing exceptions

The standard "std::ostream & operator << (std::ostream &, …)" operators do not throw exceptions upon failing to write to the underlying std::streambuf. Instead, they set failbit on the ostream. This was causing output errors to be silently ignored in several places. This change adds calls to std::basic_ios::exceptions(…) to enable the std::ostream instances to throw exceptions when their failbit or badbit is set.
do not call sync() in ~WebSocketBuf()

WebSocketBuf::sync() can throw exceptions, so it should not be called in a destructor.
use static_cast when casting from void *