_frontend/complete.py: Workaround API break in click.Path()

Since around the release of click 8.x, we have an API break in
the click.Path() parameter type, where one of it's public members
we were relying on has gone missing.

See upstream report: https://github.com/pallets/click/issues/2037

This was fairly easy to work around.
diff --git a/src/buildstream/_frontend/complete.py b/src/buildstream/_frontend/complete.py
index 45e857e..d17bb73 100644
--- a/src/buildstream/_frontend/complete.py
+++ b/src/buildstream/_frontend/complete.py
@@ -150,7 +150,19 @@
     elif isinstance(param_type, click.File):
         return complete_path("File", incomplete)
     elif isinstance(param_type, click.Path):
-        return complete_path(param_type.path_type, incomplete)
+
+        # Workaround click 8.x API break:
+        #
+        #    https://github.com/pallets/click/issues/2037
+        #
+        if param_type.file_okay and not param_type.dir_okay:
+            path_type = "File"
+        elif param_type.dir_okay and not param_type.file_okay:
+            path_type = "Directory"
+        else:
+            path_type = "Path"
+
+        return complete_path(path_type, incomplete)
 
     return []