Don't create a shared pointer from "this"

The reference count could fall to zero while the pointer is still in
scope: the object will be freed before the pointer is used

Fix by Tom, yay!