I don't think this is possible as TeamViewer often run under Administrative privileges. And I have used TeamViewer for quite a while, and the TeamViewer bar has its own Shutdown button, which I believe basically send some commands directly to the OS.
The only thing you might be able to do is to set up TeamViewer to "confirm" everything the person connecting do.
To do this you go under Options - Advanced - Advanced Settings for Connections to this computer.
Access Control -> Custom Settings
Under "Control this Computer" might want to change it "After Confirmation" -
He can't control unless you give confirmation. He can only connect and view your screen.
and
Lock the local keyboard and mouse "Denied" - so he can't lock you out
and
Control the local TeamViewer "Denied" - so he can't change that setting.
Hopefully that helps. (I haven't personally tested it, but those are the relevant options that I can think of)
Darius