Remove the last uses of 'using std::error_code'

This finishes the transition to std::error_code.