lib: media_list: add nullability checks and fix memory leaks
This adds missing nullability checks to the media list player fixing numerous crashes on the iOS port. Additionally, it backports memory leak fixes inspired by !3503
The added sanity checks are exclusive to the 3.0 branch as the implementation was re-done for 4.0.