PTHREAD_MUTEX_INITIALIZER and PTHREAD_COND_INITIALIZER should only be used for statically allocated mutexes - not doing it here breaks building on 64-bit Android.
Cleanups and stream type support