Added thow bad_alloc to failures of shared_malloc