Fix: explicitly set ptr to NULL on asprintf error

Fixes #27

Reported-by: George Kadianakis <desnacked@riseup.ne>
Signed-off-by: David Goulet <dgoulet@ev0ke.net>