Adds mutex for free_mem_calls and alloc_mem_calls counters in
os_base.[hc].

This change required the modification of the os_thread library so that
mutexes aren't created dynamically with alloc_mem (circular dependency).

 On branch para
 Changes committed:
	modified:   lib/os.h
	modified:   lib/os_base.c
	modified:   lib/os_base.h
	modified:   lib/os_thread.c
	modified:   lib/os_thread.h
	modified:   lib/setup.c