participant: stop http serving when stopped
server: fix possible race when switching mode