swtpm_ioctl: Only close file descriptor if >= 0 (Coverity)

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
diff --git a/src/swtpm_ioctl/tpm_ioctl.c b/src/swtpm_ioctl/tpm_ioctl.c
index 9c26add..9eb785c 100644
--- a/src/swtpm_ioctl/tpm_ioctl.c
+++ b/src/swtpm_ioctl/tpm_ioctl.c
@@ -1316,7 +1316,8 @@
 
 exit:
     free(tcp_hostname);
-    close(fd);
+    if (fd >= 0)
+        close(fd);
 
     return ret;
 }