Are aware of audiophonics.fr?I am envisaging a problem here. Since the media center is within the box, the power off may not always be controlled and also it may not be preceded with turning off the media center. The result maybe a corrupt database and that would leave Kodi unusable for next time...any thoughts? There are suggestions on super capacitors in some forum...there should be a better way to do this...
They have a lot of inexpensive kits and modules to let you add features to an RPi based system. One of the things they've developed is a small PCB which can handle power cycling of the RPi. When you hit the power button, this PCB sends a signal to one of the GPIO pins of the RPi, and a daemon running on the RPi triggers a clean shutdown. It similarly also supports a clean startup.
All the pages are in French, so use Chrome to browse the site and translate each page into English with one click. The software for the daemon to do the shutdown is provided as free download, I believe. They have a forum where they answer DIYer queries.