Terminating search for stack frame with source when reaching the end of the stack.

The previous attempt of checking for None didn't work since we get
exception instead of None for getStackFrame.