handle degenerate cubic loops

fuzzer generated a cubic with a very tiny loop at one end.
Breaking the cubic in two generated a piece so small it was
discarded, passing the original along.

Instead, use the loop detection as a hint that passing
the original may fail further along. Keep the big piece,
which is more linear than the original;
and change its end to match the original input if the
small piece isn't worth keeping.

R=kjlubick
Bug: skia:7480
Change-Id: If4c5cd46dbf7e16526269f2854e4f2278f427461
Reviewed-on: https://skia-review.googlesource.com/103100
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
4 files changed