init: fix more cases of leaking pid_file