Got thread exit and join working to a first approximation