Improve termination process of pione-client.