use HOST_NAME_MAX to size buffers for gethostname(2)
POSIX limits the length of host names to HOST_NAME_MAX. Export the
fallback definition from daemon.c and use this constant to make all
buffers used with gethostname(2) big enough for any possible result
and a terminating NUL.
Inspired-by: David Turner <redacted> Signed-off-by: Rene Scharfe <redacted> Signed-off-by: David Turner <redacted> Reviewed-by: Jonathan Nieder <redacted> Signed-off-by: Junio C Hamano <redacted>