[CMAKE] Fix daemon() detection on OSX
Summary: On BSDs and macOS, the daemon() function is located in stdlib.h.
Test Plan:
On OSX:
cmake -GNinja ..
Check daemon is found.
ninja ./src/bitcoind -daemon
Check the argument is supported and works as expected.
Run the OSX Gitian build and test the -daemon option is supported on
the produced bitcoind binary.
Reviewers: #bitcoin_abc, deadalnix, jasonbcox
Reviewed By: #bitcoin_abc, jasonbcox
Differential Revision: https://reviews.bitcoinabc.org/D5006