A Kentucky sheriff has been charged with murdering a judge who was shot dead in his courthouse chambers.