Commit to the database earlier in the process so the JSON sent is up to date
Otherwise, the JSON representation of the object was not up to date which
resulted in some odd notifications (ie: a new comment added while the
comment did not show up in the JSON, or a new tag which does not show,
and so on).
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>