Fix exception specifications for C++17