Them mbedTLS read and write functions will never read or write more than
the negotiated fragment length at every iteration (which usually depends
on MBEDTLS_SSL_IN_CONTENT_LEN and MBEDTLS_SSL_OUT_CONTENT_LEN).
For this reason, when reading or writing partial data, we must always
keep retrying until we receive a "would block" (no bytes read or wrote),
or we have fulfilled the read or write.