gh-36297: using more libgap instead of gap
just a few more uses of libgap instead of gap
### :memo: Checklist
- [x] The title is concise, informative, and self-explanatory.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation accordingly.
URL: https://github.com/sagemath/sage/pull/36297
Reported by: Frédéric Chapoton
Reviewer(s): Dima Pasechnik