set application buffer size to not exceed tls record size and handle buf...

...fer overflow condition. fixes #1896