We have two functions:
gnupg_inotify_watch_delete_self to monitor homedir.
gnupg_inotify_watch_socket to monitor socket(s).
And gnupg_inotify_has_name to see removal of socket.
FindFirstChangeNotification could be used on Windows:
https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-findfirstchangenotificationa?redirectedfrom=MSDN