Malloc free counter

added a counter to safe_malloc/safe_free so we can match the two and make sure we don't have leaks.

fixed multiple errors in linked_list test case.

fixed memory leak in linked_list (sentinel node was not free'd)