bnc#862514: Handle corner case in slide sorter correctly.

We should never return -1 when bIncludeBordersAndGaps is true; but that could
have happened in a corner case:

* export SAL_USE_VCLPLUGIN=gen
* start LibreOffice
* open a presentation with many slides
* resize the window so that it shows the slides _exactly_, no slide is cut
  off in the slide sorter
* point the mouse pointer into the left "Slides" sidebar (slide sorter) so
  that it does not cause any mouse-over effect (somehow between the left
  border, and the slides - there is space that can do this)
* turn the mouse wheel all the way down so that the last slide is at the
  bottom
* turn the mouse wheel up _once_
* turn the mouse wheel down _once_ - it will look like the view does not
  change (the last but one is still at the bottom), but you can see the
  scrollbar jump to the top
* and now you can again start turning the wheel all the way down to repeat
  the procedure :-)

Change-Id: I0253c89513222a1f2eb3263068997d10eea0f130
Reviewed-on: https://gerrit.libreoffice.org/10683
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>