input: factor if and add error handling to demux_New()
input: correct default value check for $demux (fixes #10475)