ABI compat fix for +-ve vals in amqp_error_string

To preserve ABI, map positive error codes into the negative error-code
domain in the amqp_error_string() function. This will preserve compat
with older code-bases that do amqp_error_string(-returnval)

Note: the function is marked as deprecated so the user will still get a
warning when compiling code that uses this function.
Set state->socket to NULL after amqp_socket_close

amqp_socket_close has the side-effect of destroying the socket object.
Use after this will cause undefined behavior
Fix latent bugs with return error-codes