Package exec: Ensure test channel is closed only once.
Package exec: Ensure test channel is closed only once.

Because the interval in the tests is very short (to avoid unnecessary
delays when running tests), the ticker may have been expired by the time
the callback function returned. This caused the next iteration to call
the callback a second time, causing it to close an already closed
channel, which triggers a panic.

This change ensures that the channel is closed only once, avoiding
occasional test failures.

collectd/go-collectd,octo/go-collectd