Fix logging error in which item_name was freed

The AVClass was being freed after the log was
issued, but before Python actually processed it
since it does so async.
Merge branch 'logging' into develop