core: only increment devices_released when a device is destroyed

Fix a typo in the last commit to ensure the loop does exit when there is
a dangling reference.

Signed-off-by: Nathan Hjelm <hjelmn@google.com>
2 files changed