lib: posix: fix couple of race conditions

Added locks around thread state accesses in
pthread_create() to avoid race conditions.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
1 file changed