Handle errors better in functions suppress_error_output() and restore_error_output().

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