cocoa_common: fix a bug in window dragging state

When going in and going out of full screen the player lost information on the
movableByWindowBackground behaviour. There were some hacks in place to fix it
but they were broken with the recent native fullscreen changes in 74c15ec6.

This commit removes the problem at the root and removes the hacks. The delegate
method `isMovableByWindowBackground` seems to be called after setFrame and
setPresentationOptions so change fs state in opts before that.

Fixes #83
cocoa_common: remove pointless locking when using -fs

When using --fs `vo_cocoa_fullscreen` was called from the primary thread. This
occurred inside `vo_cocoa_config_window` which is scheduled for excution on the
primary thread with libdispatch).

All of this caused spam from NSRecursiveLock in standard output.
cocoa_common: don't use recursive locking

This was in the original change set for the threadsafety changes but I forgot
to squash it in.
cocoa_common: order front window only when invisible

Window creation code always made mpv the front window. Fix it to make it front
only if the window is currently invisible.

Fixes #84
chmap: fix oddity due to ambiguous 6.1 ffmpeg channel layout

FFmpeg (as well as Libav) have two layouts called "6.1":
AV_CH_LAYOUT_6POINT1 and AV_CH_LAYOUT_6POINT1_BACK. We call them "6.1"
and "6.1(back)". Change the default layout for 7 channels as well to
return the same layout as av_get_default_channel_layout(). (Looks a bit
questionable, but for now it's better to follow FFmpeg.)
cocoa_common: order front window only when invisible [2]

Followup to 8df7127. This refines the condition for front ordering the
condition to account for minimized or hidden state where the window should go
to the front only as a consequnce of user interaction.
vd_lavc: hack-fix vdpau decoding with non mod 16 video

This changes the code so that it does the same as MPlayer, mplayer2
and mpv before ref-counted AVFrame. The problem is that get_buffer2
is called with aligned frame dimensions, while get_buffer didn't. This
breaks the mpv video frame size change detection.
m_option: fix segfault in parse_chmap
command: simplify sub OSD update

We can just update all OSD elements in these cases. This way we can also
reuse it for commands which need to update the OSD for other reasons.
add osd-scale command

Signed-off-by: Paul B Mahol <onemda@gmail.com>

Modified to add docs for --osd-scale option, and adjusted to the
previous commit by wm4.
demux_mkv: export Matroska title element as metadata
command: use "title" tag for media-title property if available

In connection with the previous commit, this will use the Matroska title
for the media-title property.
options: add --version
options: use case-sensitive comparsion for options

This is better for consistency, and also allows using -V as alias
for --version.
options: add -V as alias for --version

This is a common convention.
mplayer: potentially fix main() return value

The main() function is special, and omitting the return statement would
make it always return 0. And also, mpv_main() actually never returns, it
calls exit() through exit_player() instead. But change it anyway,
because it looks misleading.
options: fix exit code when using help options

Basically a cosmetic change. Fixes github issue #88.
vf_dlopen examples: add framestep filter

Usage: -vf dlopen=./framestep.so:5
vf_dlopen examples: slightly simply the framestep filter

We don't need config() ;)
cocoa_common: vo_corevideo: fix window initialization

vo_corevideo doesn't create a hidden window to perform OpenGL extensions
detection. This caused the window to always stay close.