[capi] Update on thread safety for ml_tensors_info
This patch fixes the case of Time of Check Time of Use bug in
ml_pipeline_custom_easy_filter_register().
The provided arguments `in` and `out` are first checked for validity
under their locks and then used for clone again under their locks.
However, between the two operations, both the variable are left lock
free, and the two variables can become invalid.
This patch adds the corresponding fix by adding support for
checking validity of ml_tensors_info_s lockfree which is done
under the lock acquired inside ml_tensors_info_clone().
Further, as a minor fix, redundant locking and unlocking
has been removed from ml_pipeline_custom_easy_filter_register().
See also #42 https://github.com/nnstreamer/api/pull/42#issuecomment-
840265534
Resolves https://github.com/nnstreamer/nnstreamer/issues/2600
**Self evaluation:**
1. Build test: [x]Passed [ ]Failed [ ]Skipped
2. Run test: [x]Passed [ ]Failed [ ]Skipped
Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>