client API: improve comments
lua: add a minor helper function
encode: add a missing \n to a log call
encode: write 2-pass stats only per-packet

The stats were retrieved and written on every encode call, instead of
every encode call that actually returned a packet. ffmpeg.c also does it
this way, so it must be "more correct". Fixes 2-pass encoding.
client API: remove outdated comments
lua: add helper function for printing a table

Although this is something really basic, Lua's standard library doesn't
provide anything like this. Probably because there are too many ways to
do it right or wrong.

This code tries to be really careful when dealing with mixed
arrays/maps, e.g. when a table has integer keys starting from 1, making
it look like an array, but then also has other keys.
manpage: document how the client API retrieves the complicated properties

"Complicated" as in they use sub-properties, and using MPV_FORMAT_NODE
allows an application to retrieve all information at once.