ASACORE-812: Fix writing PID file when switching user.

Typically, a Linux daemon must write its PID to the pidfile under
/var/run/ prior to switching to an unpriviledged user.  The code prior
to this change would try and fail to create the pidfile because it
switched to an unpriviledged user first, then tried creating the
pidfile.  This change swaps those operations.

Change-Id: I047cad37b6f8d7f2de7305aa100be06314e95d8f
Signed-off-by: Steve Kinneberg <stevek@qce.qualcomm.com>
Merge "ASACORE-812: Fix writing PID file when switching user."
Merge remote-tracking branch 'origin/master' into temp/integration-14.10

Change-Id: I43ddac8908b350f9223a8014eae93a403cb63d87
Signed-off-by: QCE Seabuild <qce.seabuild@qce.qualcomm.com>