plugins: stop process before calling set on it

A naïve fix for #19. We may think of a better approach in the future.