update for new API

rewrite scanner to loudness detector sink
loudness detector: implement attach method

also implement signaling and waiting on cond for events in loudness
detector and player
add cond signaling and waiting to encoder

and add forgotten cond cleanup to player
loudness detector: implement detach
add missing uv_mutex_init and uv_cond_init calls to encoder