Fix #13818 by using more robust "find next carousel item" logic

Also adds another test for #9461: carousel next/prev should ignore non-items
Merge pull request #14069 from twbs/fix-13818

Use more robust "find next carousel item" logic