Fix null closing when gmond fails to open socket.

Segfault when gmond fails to open socket,
this happens when fd reaches ulimit.

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
Signed-off-by: Takashi Kajinami <kajinamit@nttdata.co.jp>