Fix duplicate tunnel check: the exclude list at SQL statement prepare time becomes too stale.
Move tunnel.SetSessionStarted() to operateTunnel() for readability.