Mechanism of gating and partial agonist action in the glycine receptor