Add an explicit disconnection function
Fix stacktrace command under uWSGI

And probably other environments using call_*() to invoke Perl code from C.

I'm not sure why this code checks the bottom of the stack, I'm changing it to
check the top of the stack in the hope that it was written for the case in
which the stack trace only contains a single frame.