Fix SessionTreeDelegate::paint() to restore the painter state