Fixed the bug in attachments_count cache, where it would count deleted items also