common: Adding clear-trap()

When running upgrade-from, we need to disable the trap unless it occurs
at the end of the script.