Added ca_file_buffer_* functions

Several table backends are going to need buffered writes and support for atomic
writev, which isn't supplied by FILE *.  Hence I created the ca_file_buffer
interface, and ported the write-once backend to it.

One goal is to support having multiple processes appending to the same log
file, so atomic writev with no user space locks is critical.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
sort.c: Seek to the beginning of the input table before reading it

With no seek before read, we risk copying only the tail end of the table.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
tests/wo-sort-00.c: Test order of table before sorting it

This will help debug errors that happen before sorting.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>
table-backend-log.c: Count the size variable as part of the row size

This slightly reduces the noisiness of the code.

Signed-off-by: Morten Hustveit <morten.hustveit@gmail.com>