Corrected a bug. matrix_free now sets it pointer argument to NULL after
freeing the memory.

Added error handling macros dbg.h (from  Z. Shwaw,
http://c.learncodethehardway.org/book/ex20.html)