audiotrack: fix too unstable delay and write taking too much time
audiotrack: fix too unstable delay and write taking too much time

- All JNIThread commands are now executed in a locked state.

- The delay (audiotrack delay + queue delay) is now calculated inside JNIThread.

- Write is now non-blocking and return almost immediately (it takes between 5us
  and 100us). Indeed when audiotrack internal buffer was full, write method was
  taking way too much time, therefore others commands were not processed in
  time (like TIME_GET).

Signed-off-by: Jean-Baptiste Kempf <7b85a41a628204b76aba4326273a3ccc74bd009a@videolan.org>

shyamalschandra/vlc,xkfz007/vlc,krichter722/vlc,shyamalschandra/vlc,xkfz007/vlc,xkfz007/vlc,shyamalschandra/vlc,shyamalschandra/vlc,shyamalschandra/vlc,xkfz007/vlc,krichter722/vlc,vlc-mirror/vlc,krichter722/vlc,vlc-mirror/vlc,xkfz007/vlc,vlc-mirror/vlc,xkfz007/vlc,shyamalschandra/vlc,krichter722/vlc,vlc-mirror/vlc,krichter722/vlc,shyamalschandra/vlc,vlc-mirror/vlc,krichter722/vlc,vlc-mirror/vlc,xkfz007/vlc,krichter722/vlc,vlc-mirror/vlc