use pidfile_context

the pidfile will now be remove by restapi when stopping. It used to be remove
by the init script only and would leave the pidfile when stopped with killall.
Merge branch 'daemon-context'