Create a stack trace only if Error.captureStackTrace is available