PGO: Separate out common isMachO logic; no functionality change

<rdar://problem/15943240>