libs: encoder: not call ensure_num_slices inside g_assert
g_assert will take no effect when glib's G_DISABLE_ASSERT macro is defined. The function inside the g_assert will take no effect and we will fail to set the correct slice number.
g_assert will take no effect when glib's G_DISABLE_ASSERT macro is defined. The function inside the g_assert will take no effect and we will fail to set the correct slice number.