lib: implement TRERRNO

TRERRNO outputs errno information stored in TEST_RETURN.
For example, this can be used for pthread-style API,
where functions do not set errno on error, but return
error code directly.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>