capmt: fix thread detach bug