We'll soon have to maintain links from sessions to entries, so let's add a refcount in entries to avoid purging them if it's not null.