Fix resource-data delete bug.

Bug 1201974.

Change-Id: I6c4692df71dc7188c0a9caf0ca6c26b67b4e168f
Add tests for resource-data delete bug.

Fixes bug 1201974

Change-Id: Id5fdfcde8541e83f68406c67250b815b35fbbf54
Merge "Fix resource-data delete bug."
Merge "Add tests for resource-data delete bug."