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`.
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.

Btw I am not 100% sure but could it be that expectedException and the whole stuff is not resetted after each test method?