close uinput in __exit__ only if a fd exists