Fix undefined variable for response status code

The status code variable passed on the error event wasn't defined,
causing a ReferenceError when the event is emitted. Changed the
status variable by a direct call to the response status code property.