Fix bug in switch_to_fork (shared_from_this() called on object declared on stack)

(cherry picked from commit 8ea98492070cafb8f8e902f9af6b4e475349a3a4)

Conflicts:
	tests/bitshares_client_tests.cpp