Implement support for stack traces for STL exceptions.

Fixes #5114