Crash fix and random warning fixes

Somehow the crash on exit that I've fixed long time ago is again here.

Also included are three commits related to compiler warnings and also two commits that remove unused (possibly for now) functions.

With these fixes obe-rt builds without warnings on my system (excluding deprecated warnings from libav related to av_reverse and {get,reget,release}_buffer functions /those guys remove APIs just for the sake of it.../).