Possible solutions:
- pthread_join at end of controlLoop where diagnostics thread is started.
- create ethercat_hardware object in main thread and pass pointer to control and diagnostic threads.
Migrated from: https://code.ros.org/trac/wg-ros-pkg/ticket/3474