Review the code and understand the cause of segfault

The problem is related to the end callback. Now, I am going
to investigate what the problem is.
Merge branch 'feature/ooni' of https://github.com/bassosimone/libight into feature/ooni