DISCLAIMER: I don't specifically recommend this app - it seems unmaintained and also request device admin permissions to be able to lock your phone.
Someone brought this app up in the Matrix rooms very recently: https://github.com/wesaphzt/privatelock
The way I understand it is that it uses the device's sensors to detect sudden movements (such as someone snatching your phone out of your hand), and then uses the device admin permission to lock your phone. This, combined with the auto reboot feature on a relatively small time frame would provide a solid defense, provided that the app triggers when the phone is snatched (it would need to be a sudden motion, not a stealthy one, but I don't see how someone can stealthily snatch your unlocked phone either.)