Maybe I'll use some kind of conductor for a temporary powersource and will use a digital pin to check if the board is running on main power or on the backup power. The temporary power source should only keep up for 2-3 seconds.
I'm having a bit of difficulty imagining how that would work. But, if you can, and can figure out how to turn the temporary power source off when the Arduino can safely be powered off, go for it.
Well, the temporary power source would be a capacitor. It would discharge in a few seconds, and it would be enough to finish the last write and skip the next write cycles until it shuts down.