swi-prolog: optional libarchive support

Also prevent finding a MacPorts installed libarchive.

Closes #28666.