isn't the process who created it. - If a new basename is supplied remove the an old pidfile if it was created by this process and create a new one as suggested by Jason Thorpe. This fixes PR lib/13357 by Greg A. Woods.
to be removed on normal exit.