darwin: fix sysroot retrieval for some systems
Got a report on Discord that the current way didn't work for a user,
this change did work and I confirmed with @harold-b (who initially added
this) that it also works for them and is actually a better way.