Fix some issues with the script:
- GraphQL query strings were built from template literals without escaping, leading to errors when sending to GitHub API, now added escaping
- Lack of visibility when GitHub API errors because the actual errors array is buried below the expanded portion of the object output, now drilling down to the usable portion of the returned error
- When the sync bot auto-adds the database ID, it also reformats the TOML frontmatter, which leads to a spurious "content changed" update when the checksums don't match in the next check run. Resolve this by normalizing the frontmatter before calculating the checksum.