Move pid file creation to main.go