Zenefits has reached a deal with investors that cuts its valuation but prevents it from being sued by shareholders.