Shares the code to exit the agent to prevent exiting without pidfile cleaning

Mackerel-agent sometime exit without cleaning pidfile. This pull-request fix the problem by replacing the os.Exit statement to the exit function with pidfile cleaning.