Fix C++ exception handling with the OpenWRT toolchain