Fix automatic changelog generation for rc builds

This fixes automatic changelog and version number generation for RC builds.

Previously they were incorrectly unhandled, but now that we actually have an
RC process, we need to step up our game.  This fixes that problem, along with
factoring out the common logic we implemented in two places.