fixed hard error state lookup

This error was posted when using aws-sdk in nock:
https://github.com/pgte/nock/issues/184

It looks like there is a problem in the error lookup code:
A JavaScript object does not have a `.indexOf` method. Instead the lookup can be done using the universal `.hasOwnProperty` method.

Also, it looks like this part of the code has no test coverage, that's probably why it slipped.