nitg & lib: intro `Finalizable` to be called when an object is freed

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
tests: test finalization effect

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>