This patch prevent SDaemon from leaking the following two file
descriptors.
* fd for log file
* fd for task id pipe
This patch also adds some "close"s to make sure output streams
get closed in SDaemon.
Change-Id: I59119243c785526f7b97ac379b0e541cabd44750
Closes-Bug: #1537982