Use BOOST_THROW_EXCEPTION instead of boost::throw_exception()

Fixes #3636