Added shutdown script:

Call of user script in /storage/.config/shutdown.sh from /etc/init.d/93_xbmc.
It also gets the current exit code of xbmc.bin (quit|powerdown|reboot) as parameter ($1), so the script can differentiate spezial actions.