sm: add config option to specify the pid

To allow rendevous for testing
sm: remove endpoint directory during cleanup
sm: use fts to unlink sock and fifo

No need to manually construct their paths.