this defer function was causing telegraf to call os.Exit(0) instead of panicking when it was supposed to. closes #2341