tests textiter: unit tests for visible word boundaries

As the FIXME comments show, there are several problems.

https://bugzilla.gnome.org/show_bug.cgi?id=618852
tests textiter: unit tests for sentence boundaries

As the FIXME comment shows, there is a bug. It is the same bug as for
the word boundaries.

https://bugzilla.gnome.org/show_bug.cgi?id=618852
textiter: fix bug in find_by_log_attrs()

Do not work with the iter passed as the function argument. Work with
another iter, and set it back to the function argument only if something
has been found.

This fixes a few unit tests. But there are regressions for a few others.

https://bugzilla.gnome.org/show_bug.cgi?id=618852
textiter: simplify FindLogAttrFunc

The min_offset parameter was always 0. Since there are some bugs in this
code, it'll be clearer if there are fewer parameters.

https://bugzilla.gnome.org/show_bug.cgi?id=618852
textiter: make the FindLogAttrFunc functions clearer

- Return true (found) and false (not found) explicitly.
- Set found_offset only when something has been found.

find_backward_cursor_pos_func() was a bit different, the while loop had
the condition "offset > 0" but the return was "offset >= 0". Probably a
micro-optimization, since offset == 0 is always a cursor position.
Anyway now the code is the same as the other functions.

https://bugzilla.gnome.org/show_bug.cgi?id=618852
textiter: fix bug in FindLogAttrFunc functions

attrs[len] is the last PangoLogAttr available, at the iter position after the
last character of the line.

For a line in the middle or the start of the buffer, the '\n' is taken
into account by 'len'. For example the is_word_end is generally reached
before the '\n', not after. But for the last line in the buffer, where
there is no trailing '\n', it is important to test until attrs[len].

The bug didn't occur before because find_by_log_attrs() worked directly
on the iter passed as the function argument. But now it is no longer the
case.

https://bugzilla.gnome.org/show_bug.cgi?id=618852