UA change: Handling bad_alloc in threads as well

This is important, since otherwise the exception is not passed to main()