Adding timeout to thread.join