ART: Refactor HandleUnexpectedSignalCommon

Avoid the std::ostringstream. Instead use a lambda and immediately
use std::cerr when asked to dump there, eventually.

Also refactor the signature to make it more explicit what the function
will handle and where it would dump to.

Test: m test-art-host
Change-Id: I2be5497d4f9957127243879113372d9aa1535d82
4 files changed