Backport of 1.4 version of patch-release-upgrade.pl.