John Legend is ‘glad’ he and Chrissy Teigen shared baby loss