plainbox:vendor:extcmd: respect the on_line() protocol

This patch changes the glibc-based implementation of extcmd to correctly
respect the extcmd's on_line() protocol. This means, that when a chunk
of data is read, it must be first split into distinct lines and only
such split bytes should be passed to the on_line(). Adherence to the
protocol should be maintained even when processing partial lines, that
is lines which are half-way read (before the '\n' byte is seen).

In practical terms, the _read_pipe() method now gets a helper argument
which stores partial data and all new data is (after being combined with
data left over from the previous call to _read_pipe()) split into
distinct lines.

Fixes: https://bugs.launchpad.net/plainbox/+bug/1401996

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
"automatic merge of lp:~zkrynicki/checkbox/fix-1401996/ by tarmac [r=roadmr][bug=1401996][author=zkrynicki]"