Fix RPM scriptlets to cope with upgrading a package.

The RPM mechanism doesn't allow you to distinguish between an install and
an upgrade so we check for the existence of a file to see if it was
an upgrade.
Refs #10784