peer: add start/stop API & clean up after trap_exit