We have seen this on large instances. Things to do:
upgrade to 5.13.5 (this also puts you close to the next ESR - a paid for service - which will be released on Nov20).
There have been performance improvements - this will help.
cull your smart groups; do you really still need all of them.
reschedule the cron job -> ask yourself how up to date your smart ...
Karin's answer is a good one. However, not all smart groups are created equal! Culling the right smart groups is what will fix your deadlocks.
Identify your slow smart groups. Here's a script (rough, could use improvement) that you can run that will show you how long it takes to build each smart group. The latest version is available on my Github:
Instead of trying to "hide" the problem when it happens, it might be safer/wiser to try to prevent it.
I like smartgroups and how powerful they are, but I found that it works better if I cache the results for a while (eg. a day) and rebuild the smart groups via the jobs.
Would it be acceptable to keep a "stalled" version of your groups for a while and ...