[TS-3257]: Fix ssl handshake buffer memory leak introduced in TS-3006
Moved TS-3257 to 5.2.x