California legislators strike last-minute deal to help oil industry but limit offshore drilling