How are you going to avoid this? You either elect the sheriff directly, or you elect the people who appoint the sheriff. Either way, they are going to be subject to political whims.
Fair enough, although there might be SOME benefit to having separate election systems for the two roles; it might provide some check against one of the election systems being compromised.