asprintf() implementation