TV remote shuts down PI

Probably not the same Toshiba model but might have similar ability …
see page 40 (printed page number) for setting in TV to enable/disable auto-standby.
I suspect that setting this to Off will stop TV sending the Power Off signal as remote key press via CEC.

http://tv.toshiba.com/media/Toshiba_40L310U_15-0048_WEB_V1_ENG_Final_lr.pdf