Merge pull request #3 from gfto/fixes

Crash fix and random warning fixes
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
Fix hang on exit.

If there are any outputs configured, trying to close them results
in endless loop due to missing check.