Properly interrupt thread. Closes #705.