tls: synthesize errno if not set.

Fixes tests on freebsd10.