add sprint_td function, print_td uses it with 64-char buffer

sprint_td somewhat mimics sprintf, for instance, returning the length.
use Check to unit test libtd

22 of 23 tests from td-test.sh can be tested using Check, the last one needs to test stdout. The benchmark would also need another way to perform.

AM_PROG_CC_C_O is added because Automake 1.13 still needs it, it's not required for 1.14+ according to the manual [1], AC_PROG_CC handles that.

[1]: www.gnu.org/software/automake/manual/html_node/Public-Macros.html
use Autotest to test multiple inputs