detect bad_alloc as out-of-memory

Clang prints the bad_alloc message on out-of-memory, and sadly only
sometimes, other times it just crashes, but this is better than nothing.
Icecream's detection of actual running out of memory seems to be broken
(and the code looks fishy to me).