Coprime subdegrees for primitive permutation groups and completely reducible linear groups