Fix the problem where the application wouldn't close
Only stop the IO service when everything else has stoped