fix cache object reference counting error

Signed-off-by: Jan Dvořák <mordae@anilinux.org>