Fix cancel timer bug reported by Andriy Redko

now cancel timer when connection is closed
make sure timer is cancelled if there is an exception in execute