Increase reference count for array elements

Click for [original pull request](https://github.com/DynamoDS/Dynamo/pull/2440).