FIX: redecl of int i in amqp_tcp_socket_writev
FIX: incorrect bit-shift in amqp_error_string2

CID 1035140
FIX: handle amqp_get_sockfd failure in wait_frame

CID 1035138
CID 1035137
FIX amqp_tune_connection don't delete state on err

amqp_tune_connection shouldn't destroy the state object on memory error,
it should be left to the calling function