Added more tests for realloc and added errno setting for malloc