Partial fix for test case tlsIO-9.1 to flush then wait for handshake to finish before close