Add SIGQUIT and SIGTERM handlers to collectd driver. Exit when cannot read from oned pipes

(cherry picked from commit 41b38d3bda083fa50f4d78d7e5baf15278f012f0)