Implements `std::error::Error` for `ErrCode`.

This change supports "Error interoperation".
See rust-lang/rfcs#201, rust-lang/rust#17747.
Merge remote-tracking branch 'gifnksm/master'