Revert #461/PR #967 to restore proper daemonization behaviour when BACKGROUND=1.  Fixes #1122.