As pointed out in
https://github.com/pulumi/pulumi/pull/13078#discussion_r1227854722,
we repreatedly reimplement the project name validation logic.
This moves it to a central place: `tokens.ValidateProjectName`,
and re-uses it in existing places where copies were found.