Add missing mutex unlock before exit the function