A gating mechanism of pentameric ligand-gated ion channels