h264: slice-mt: check master context for valid current_picture_ptr

Fixes errors in slice based multithreading introduced in 0b300daad2f5.

CC: libav-stable@libav.org
(cherry picked from commit 5945c7b35d9169caf9ecef1c419eebdebb909e60)
Signed-off-by: Diego Biurrun <diego@biurrun.de>