Replace strerror with C++11 std::error_code.

This removes the crazy strerror_r handling.