Fix bug in LazyStub.__getattr__

When run with optimizations turned on, the assert statement
is not executed. This results in incorrect behaviour.