Active site restructuring regulates ligand recognition in class A penicillin-binding proteins