[Core]  Fix heap overflow in LayoutPass.

Found this with asan. Code assumes that find doesn't return end, thus if
both atoms didn't have followon roots it would still compare their positions.

git-svn-id: https://llvm.org/svn/llvm-project/lld/trunk@191865 91177308-0d34-0410-b5e6-96231b3b80d8