pthread: make ff_thread_release_buffer idempotent.