Java exit on pending threads: solved