Fixed ReleaseData functionality in algorithms.

It turns out that ReleaseData has been broken for a while, in
that it didn't release data. No test looked at this so nothing
failed. Fixed. I also added a test. As Bill Lorensen always
says "if it is not tested, it is broken"

Change-Id: Iae817886d5dca88752df6c6f5496bb229b6ea43f
Merge topic 'release-data-fix' into master

6c965828 Fixed ReleaseData functionality in algorithms.