Write a pidfile on request, and delete it when finished.