@Gargron I wouldn't expect you to be able to fix that, that's for sure! It appears that Webkit - and other browsers - have a feature called background tab throttling. One Chrome et. al you can shut it off. But Safari doesn't have a preference for that unless you use a preference rewrite via Terminal.
If I come across anything that will help keep Mastodon alive even if Safari tries to kill the connection I'll update this thread.