Fix problem caused by race condition in scope creation

Now the scope is set whether or not the scope creation is successful.
This ensures that if two connections try to create the same scope at
the same time, both will end up with the right scope.
Merge pull request #15 from mdalepiane/patch_scopes

Fix problem caused by race condition in scope creation