Move the logic to update the build-init version resource into the `gradle/gradle` build.

This allows the logic to be specific to the current Gradle version rather than attempting to work for versions that might be promoted, for example when the resource format or target JVM changes or a new library or plugin is required. This also allows the versions to be updated at any time, rather than only during release branching.