taskd: PID file related fixes

1) use /var/run/taskd[profile].pid when running as root (this fixes a known
problem with stopping taskd with /etc/init.d scripts

2) PID file was being mistakenly being written before the first fork, what
was writing the wrong PID on the file. Now the PID is written after the
first fork.
install.sh: fixed install directory check problem

fixed bug when running with from_bootstrap=1 it was not allowing to remove the
existing dir.