Open pid file in 'w' mode