Delete/detach now properly take care of usage count

Signed-off-by: Shahbaz Youssefi <ShabbyX@gmail.com>