[backends/common] Terminate backend when last client disconnects