Prevent same upgrade from being applied multiple times.  Fixes #28.