test_nvtable: make functions static

So that we can notice if a test function is not being called as the compiler
will warn about it. And its good style anyway :)

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
nvtable: nv_table_realloc() fixed the initialization of the size member

The size member has remained at its old size if there were multiple
refs to the NVTable thus a new allocation occurred. This was
shadowed by the fact that syslog-ng will happily realloc the ref==1
NVTable later on, at the cost of another realloc.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
nvtable: nv_table_clone is fixed to limit NVTable size fo NV_TABLE_MAX_BYTES

This check was omitted, thus nv_table_clone() was able to grow the
NVTable over the allowed limit.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>
test_nvtable: added testcases to cover realloc/clone corner cases

This unit test is now a mess, I hope to clean that up one day, otherwise
this improves coverage and adds validation on two, previously uncovered
issues.

Signed-off-by: Balazs Scheidler <bazsi@balabit.hu>