isn't there a race condition between writing the pidfile here and deleting it down there?