Prevent obecli crash on exit when obe is not started.

Just starting obecli and then exiting results in segfault.

> user@enc:~/obe-rt# ./obecli
>
> Open Broadcast Encoder command line interface.
> Version 1.0
>
> obecli> quit
> closing obe
> input cancelled
> filters cancelled
> encoders cancelled
> Segmentation fault

This patch fixes the segfault by not allowing pthread_join( NULL, ...) to called.
Fix warnings about possible usage of uninitialized variables.

The warnings were:
> input/sdi/sdi.c: In function 'obe_v210_line_to_nv20_c':
> input/sdi/sdi.c:74:23: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
> input/sdi/linsys/linsys.c: In function 'capture_data':
> input/sdi/linsys/linsys.c:237:20: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
> input/sdi/linsys/linsys.c:215:14: note: 'val' was declared here
Fix C++ warnings related to structure initialization.

The warnings were:
> input/sdi/decklink/decklink.cpp:68:1: warning: narrowing conversion of '-1' from 'int' to 'uint32_t {aka unsigned int}' inside { } is ill-formed in C++11 [-Wnarrowing]
> input/sdi/decklink/decklink.cpp:76:1: warning: narrowing conversion of '-1' from 'int' to 'uint32_t {aka unsigned int}' inside { } is ill-formed in C++11 [-Wnarrowing]
> input/sdi/decklink/decklink.cpp:97:1: warning: narrowing conversion of '-1' from 'int' to 'uint32_t {aka unsigned int}' inside { } is ill-formed in C++11 [-Wnarrowing]
Move functions to prevent unused warnings.
Remove defined but unused variables.
Remove defined but unused functions.
Merge pull request #3 from gfto/fixes

Crash fix and random warning fixes
Merge branch 'master' of github.com:ob-encoder/obe-rt

Conflicts:
	obe.c
Stop using av_reverse which is deprecated by libav developers.
Prevent crash on exit.

Calling pthread_cancel( NULL ) results in the same crash as calling
pthread_join( NULL, ... )

This fixes the following:

  Start obecli.
  obecli> set input decklink
  obecli> set input opts card-idx=0
  obecli> probe input
  Probing device: Decklink card 0. Timeout 20 seconds
  Detected input streams:
  Input-stream-id: 0 - Video: RAW 720x576i 25/1fps
  Input-stream-id: 1 - Audio: PCM 16 channels 48kHz
  Encoder outputs:
  Output-stream-id: 0 - Input-stream-id: 0 - Video: AVC
  Output-stream-id: 1 - Input-stream-id: 1 - Audio: RAW - SDI audio pair: 1
  obecli> quit
  closing obe
  Program received signal SIGSEGV, Segmentation fault.
  0x00007ffff6675be1 in pthread_cancel () from /lib64/libpthread.so.0
  (gdb) bt
  #0  0x00007ffff6675be1 in pthread_cancel () from /lib64/libpthread.so.0
  #1  0x00000000004483d1 in obe_close (h=0x1417860) at obe.c:1233
  #2  0x000000000044433f in stop_encode (command=command@entry=0x0, child=child@entry=0x0) at obecli.c:1353
  #3  0x0000000000446d92 in main (argc=<optimized out>, argv=<optimized out>) at obecli.c:1534
Prevent hang on exit.

If there are any outputs configured, trying to close them results
in endless loop due to missing check.
Merge pull request #4 from gfto/fixes

Crash fixes and removal if deprecated libav feature.
Merge branch 'master' of github.com:ob-encoder/obe-rt
Free model name pointer
Placate C++
Don't malloc a zero byte chunk of memory.
Free output structure
Match decklink capture example with referencing
Revert "Match decklink capture example with referencing"

This reverts commit 4eb32e96611df999d4ee4255076218ae505feed7.
Destroy out_cv in queues