ceph_mon: split postfork() in two and finish postfork just before daemonize

We split global_init_postfork() in two: start and finish, with the first
keeping much of postfork()'s tasks except closing stderr, which we leave
open until just before we daemonize.  This allows the user to see any
error messages that the monitor may spit out before it daemonizes, making
sense of the error code (which we were already returning).

Fixes: 7489

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
ceph_mon: all output after initial fork go to dout/derr

We were doing it in some cases, and not doing in some other cases.  Just
do it throughout.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
ceph_mon: output error message if unable to bind.

Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
Merge pull request #1458 from ceph/wip-7489

ceph_mon: split postfork() in two and finish postfork just before daemonize

Reviewed-by: Sage Weil <sage@inktank.com>