honor wrap option in Carousel.getItemForDirection

Fixes #15144. Demo: http://jsfiddle.net/9qxsyf27/1/
Also adds unit test for Carousel's `wrap` option to avoid such regressions in the future.
CC: @KostyaTretyak @hnrch02 @XhmikosR @fat