Use errc/what constructor for std::system_error

Use constructors for system_error as defined in the C++ standard
to ensure portable behaviour.