tests: more sensible behavior if malloc fails