doc: Fix race conditions in service handling