add gcc printf typecheck magic to print() and fix the three warnings found.

/* http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html */
void print(log_level_t lvl, const char *format, void *id, ... )
       __attribute__ ((format (printf, 2, 4)));