Xmr-stak do drop connection with pools, when pools do not provide work or reply during 5 minutes. So when xmr-stak looks for share longer than 5 minutes, and pool during that time does not provide new job - xmr-stak disconnects.
Possible solution for miner is to use static-diff with lower target time, 30 seconds for example. See
static diff calculator.
Yeah, I know about setting fixed difficulty - I was one of the first here to bitch about vardiff going nuts (shooting up to 100001 after a few minutes of mining... with a CPU).
But the problem you describe isn't the result of not having any shares accepted in 5 minutes, rather, it is from not receiving any new
blocks to work on in >5 minutes... I occasionally see that with Claymore, too, even though the default reconnect time for it is 15 minutes (which seems reasonable).