Close pid file after RW
Small code enhancement