fix pidFile not been writen error.

The pid file haven't been write after the child is start 
so i add a function to add write the pid to a file use the ```options.pidFile```