Enable -Wconversion for API files and fix errors
Replace unnecessary `xcalloc` call by `xmalloc`