Return the actually used stack after added a stack to a project

To display stacks of a project in the front-end, stacks are added to the
project object. In case one tries to add a stack that is loaded already,
the project keeps using the already loaded stack. If the stack is not
present, it will be added. This commit adds a change to make the
actually used stack available to the caller, by returning a reference to
it.
Make sure the correct stack is used after a stack is added

In case a stack with the very same ID is already present in a project,
this existing stack will be used and no new stack will be added. Since
the project opening code continues using the stack after adding it, this
commit makes sure that the correct stack instance is used after it is
tried to add a stack.
Allow completion callback for openProjectStack() method