[OCaml][DebugInfo] Add tests for debug info API
In the process of adding the tests, several bugs were
found in the implementation and interface of the API
and they were fixed.
Some utilities from the core tests (core.ml) were moved
into a separate file for reuse.
The following new functions have been added:
llmetadata_null. The third one already existed but
is now exposed publicly.
Differential Revision: https://reviews.llvm.org/D99403