fix write_pid called after daemonize call

To control daemonized process, we must call write_pid
after the daemonize() call.

Signed-off-by: Hiroaki KAWAI <kawai@stratosphere.co.jp>
Merge pull request #36 from iHiroakiKawai/write_pid_after_daemonize

fix write_pid called after daemonize call
fix problem where ip and mac address not copied correctly into match structure
fix issues related returning variables off the stack
fixes issue in port desc multipart reply due to incorrect use of variable port