Fix for crash whereby TDRouter could get messaged after deallocation

Fixes #266.