Make standard error suppression a little bit more robust.

Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com>
Add more tests and some tests fixtures.

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