Fix bug with exclude patterns and uncovered code

It seems that I was too hasty in writing my code for option to exclude unreachable branches. I did not test cases when using GCOV/LCOV exclude patterns on not executed code lines or exception handling.
This commit fixes the bug and adds tests for it these cases.