Check realloc() return value and gracefully handle a failure

Audiograph reads the entire audio file into memory. Using audiograph with large audio files on a constrained system can exhaust available memory and result in a realloc failure. This patch checks the return value of realloc() so that failure is handled gracefully. Previously a segmentation fault resulted, which led to a bit of head-scratching!