core: Flush z_datamodel after managing new categories

Otherwise managed predicates fail directly after.

(cherry picked from commit af0f5779c52fdf623422db6e7a12cf5c8a901a4e)