Close the file with correct fd if gettattrs fails.

Also, removed setting the file descriptor when we return failure.

Signed-off-by: Malahal Naineni <malahal@us.ibm.com>
Acked-by: Marc Eshel <eshel@us.ibm.com>