Don't deadlock on connect close while sending Index (fixes #386)