xmalloc(): try to free on OOM, but aborts the program if it fails to malloc() again

`xmalloc()` inspired by git's `xmalloc` wrapper. [1]

[1] https://github.com/git/git/blob/master/wrapper.c#L45