core: fix return status pipe machinery in non-daemon mode

upstream fix: 33b4d925d42348fd7a6dfad94d1ada0118ea49be