Remove freopen(3) in favour of open(2)/dup(2) et al solution.

Also, re-factor SUPPRESS_ERROR_OUTPUT macro to avoid duplication.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>