[bugfixes] fixed crash in demo app

- unsafe multi-threaded access to ncurses window structures
[untracked] updated simple logger
[untracked] updated refine_log.sh script to handle new log file formats
ref #1830 [flush audio playout structures after rebuffering]
re #1830 [don't apply ac-sync adjustment when playback time is inferred]

- when playback time is inferred for the packet - do not apply av-sync
drift adjustment (it will be applied later for normal packets)
ref #1830 [restrict ac-sync adjustment value to maximum of 50ms]

- if audio packet is leading video for more than
MaxAllowableAvSyncAdjustment (50ms) then adjustment is set to this
value. next packets will be adjusted as well unless total drift would
be consumed