Use indexOf to find connection when removing from pool

fixes #611