vf-metadata: fix handling of NULL metadata

lavfi would segfault due to a NULL dereference if it was asked for its
metadata and none had been allocated (oops). This happens for libav
which has no concept of filter metadata.
vf_lavfi: reset metadata in reset()

It might have been nice not to do this so that metadata could
accumulate accross seeks, but it seems libavfilter looses its copy
anyway on recreate_graph.
TOOLS: improve autocrop.lua

It now inserts no filters and does nothing until the hot-key is pressed.
This makes it more suitable to be put in ~/.mpv/lua.

When they hot-key is pressed, it now removes any existing crop filter and
inserts the cropdetect filter. It then samples the whole file to determine
crop parameters and uses them to insert the new crop filter. The cropdetect
filter is then removed and the original file position restored.