built_in: Add min_t() and max_t() macros and use them

Introduce non-typechecking versions of min_t() and max_t() and use them
where a cast would be needed.

The macros were taken from the Linux Kernel, release under GPL v2.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>