Regarding the backup/restore function in the commit bb3205709aa9f83e1c8cb91e7f6f9f110d41b34e, for me it seems bringing in more critical dangers than the safety it provides.
The logic is too error prone, it relies on on_exit() absolutely never duped by any fork()'s, meaning it's requiring absolutely every fork() in the entire code to be patched. And there is no safeguard against misfiring of restore_backup_on_exit(). It itself is "just irrevocably removing them as the first action," even if there is nothing to be restored. Oh well. I bet it's better to set onhold on grub for now...