Added checks to prevent errors on JACK client close.