This is to avoid wrongly read/write thiz->initialized when multi-thread invoking encoder init function, it is possible when user apps deploy multi-thread to dynamically change encoder's settings. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7578>