target/etm: add check for calloc error