[PATCH openEuler-22.03-LTS] sh: push-switch: Reorder cleanup operations to avoid use-after-free bug