Disable foreground pidfile creation if not defined

Closes #1967