Solving problem with internal classes

This is my fix, first commit will introduce a test to reproduce the error, the second one will be the fix for it.

Related to #59
> This makes sense, we store the handler and set it back if it was valid. If `null` was returned I will call `restore_error_handler`.

Then you can proceed with that plan.

> We can also check if it was modified after setting it back and let the whole suite fail, cause a test should set it back.

That would be topic for another PR I guess.

> Btw I am not 100% sure but could it be that expectedException and the whole stuff is not resetted after each test method?

If it isn't, then all tests after one that require exception to be thrown would fail, because they won't throw that exception. Unless the test, that throws exception naturally is the last executed :) If you with to investigate, then send it in a separate PR please.