capi: fix sparse warnings using integer as NULL pointer