gh-38553: Fix `DiGraph.dig6_string` when the digraph has loops
The [`digraph6`
format](https://users.cecs.anu.edu.au/~bdm/data/formats.txt) works
perfectly well when a directed graph has loops, so don't raise an
exception in that case.
- Fixes https://github.com/sagemath/sage/issues/38552
### :memo: Checklist
<!-- Put an `x` in all the boxes that apply. -->
- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.
### :hourglass: Dependencies
None.
URL: https://github.com/sagemath/sage/pull/38553
Reported by: Ricardo Buring
Reviewer(s): David Coudert