playlist: decode_head waits on a mutex condition instead of sleeping

1/3 for #24
playlist: when sinks are full wait on mutex condition

instead of sleeping. 2/3 for #24
encoder: draining uses a mutex condition instead of delay. closes #24