Make sure nodes are ready before trying to join them

Cherry picked from master.