Fix SessionResource shared pointers breakage
Before this commit, SessionResourceSP would be broken
on session->restore(). This commit fixes it by ensuring
all session->restore() calls can only be done in KisPart
and providing a function to call it instead,
so KisPart has the correct shared pointer and the session
is restored correctly.