Initialize xmp to NULL for xmp_free_context. Update tests.