In my experience, TCP connection on SIM800 is very unstable. You should try avoiding the use of delay() between commands. Try to capture and interpret the response of the module after each command and immediately send the next command, as the TCP connection seems to be very time sensitive (and generally inpatient). The module is already very slow, so adding delays might be worsening the situation.
Also, if you can avoid using TCP and switch to HTTP, the interface in the SIM800 is much better, as it lets you prepare all the data and send it in one go (thus avoiding those pesky time constraints).