Make sure we check snprintf return value for failure or truncation before
using it. Make uu_lock_txfr work by properly checking return value from
put_pid(). Fix an FD leak on the lockfile in an error path (from FreeBSD
with modifications). OK millert@, input from otto@ and Bruno Rohee.