TS-3196: Core dump when handle event check_inactivity.
This closes #147.