ApplicationErrorReport: Sanitize stack trace

Makes sure that the size of the stack trace does not exceed
40 KiBi, to ensure that even errors with large stack traces
are properly reported to ActivityManagerService. For good
measure, also ensure that the exception message is not too
long either.

Change-Id: Id8a99094023c15a981b1b79fd9ee0d803921e220
Fixes: 29918978
1 file changed