Cleaner fix for segfault at exit on av_lockmgr_regiter (SF-192).