test: Fix regression in tls test

Undefined reference, introduced by a77c29a.
tls: Write pending data on socket drain

Fixes #4800