Merge pull request #878 from heuripedes/master

(Threaded video) Fix null pointer dereferences
video_thread_wrapper.c - make code safer - prevent more null pointer
dereferences
menu_common_shader_manager_set_preset - handle possible null pointer
dereference
Start getting rid of driver_funcs.h macros
Replace more driver_funcs macros
Rewrite more driver_funcs macros
Move wayland context in context list below X11 - gets rid of
'Failed to connect to Wayland server context' warning when
running in X11
Change .retroarch-game-history.txt to retroarch-game-history.txt