Change GCRetain() and GCRelease() order

Merging changes from development branches into release branches. Details of the change can be found in [the original pull request](https://github.com/DynamoDS/Dynamo/pull/2419).