fix build on gcc 4.8
tools: add more ways to stop the node