Fix double close(2)

Reported by:	Coverity Scan