Preventing System.NullReferenceException when deserializing invalid responses

Added missing ErrorException initialization when creating RestRequest<T> from regular request.

Modified Deserialize<T> so that the deserialization is only preformed when the request returned successfully. This because the current implementation threw an useless error when for example the request timed out and no correct header was present to be processed. This error was not caught and even if it was it would override the source error already stored in the response object. 

In addition to this, a bare object was returned even when there was nothing to deserialize (invalid request, ex. 404). The returned object should of been null.