host: Rewrite logbuf.

Log reading is essentially composed out of two parts: reading the old log lines
out of a log file, and (if streaming), keeping track of new log events and
forwarding them to the client.

As such, we create a listener based system, where Log will now follow a stream,
and transmit any new events. Internally then we use the same listener to write
logs to a file (buffered to one JSON object per line, or to a certain maximum
length), and provide a utility function that reads the events back from the
file, and sends them back into a specified channel.

So the procedure for returning logs, and following the tail: we read and stream
old lines, then we subscribe a listener and keep looping to receive new lines.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Logbuf now can return a select number of log events.

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Implement log buffer line limiting for libvirt-lxc backend.

refs #133

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>
host: Implement log buffer line limiting for the docker backend.

refs #133

Signed-off-by: Blaž Hrastnik <blaz.hrast@gmail.com>