Improved warnings suppression.

Accepted Troy's suggestions. In tpl_dump(), cast to int from a write() return value
is performed after checking for INT_MAX.
Also, avoiding use of ssize_t (in favour to size_t or long+cast) to be windows
friendly.