Refactor connection task management to avoid cancels (#117)