Fix previous fix.
Close the fd on failure.

Spotted by: Coverity