Added configure option editor_autodetect_linebreak

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Added unit tests for checking "detect type of line breaks" functionality

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
edit.c: Make line break detection much more conservative.

Detection now requires consistent line breaks being present within sampling
buffer. If breaks of different types are found, or there's a slightest
suspicion that it may be binary content, it reverts to binary-safe "as-is"
mode.

Also, refactor detection routines to facilitate unit testing.

Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
tests: detect_linebreaks.c: Revamp for latest codebase.

Also, test only line break detection algorithm, not anything else (no
file operations, etc.).

Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>