Fix issue with curl not properly returning when an error occurs

Issue https://github.com/sendgrid/sendgrid-php/issues/48

Must grab the error before closing curl, then return it after closing curl if applicable.