libx265: Write global extradata when requested

Matroska, MP4, and other containers require it.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libx265: Only use one memcpy for headers

They're guaranteed by the x265 API to be contiguous in memory.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>