Impacted versions: 10.0

Steps to reproduce:
- Install a new language
- Open the language and click on "Deactivate"
![image](https://user-images.githubusercontent.com/6352350/33546866-7b2a9412-d8e2-11e7-818e-6a5be3801dc0.png)

You'll now get a traceback:
![image](https://user-images.githubusercontent.com/6352350/33546831-5ec2581e-d8e2-11e7-8887-08c0443bb1d8.png)

The issue is coming from https://github.com/odoo/odoo/blob/ab52c636c34b6f8b472a3b45ee162824de08fca4/odoo/addons/base/res/res_lang.py#L227


Current behavior:
Expected singleton error.

Expected behavior: Language is deactivated.


odoo/addons/base/res/res_lang.py
lang_codes = self.mapped('code')
        if 'code' in vals and any(code != vals['code'] for code in lang_codes):
            raise UserError(_("Language code cannot be modified."))
        if vals.get('active') == False:
            if self.env['res.users'].search([('lang', 'in', lang_codes)]):
                raise UserError(_("Cannot unactivate a language that is currently used by users."))
            
            default_lang = self.env['ir.values'].search([
                ('key', '=', 'default'),
                ('name', '=', 'lang'),
                ('model', '=', 'res.partner')])
            if default_lang and default_lang.value_unpickle in lang_codes:
                default_lang.unlink()
        self.clear_caches()
        return super(Lang, self).write(vals)
    @api.multi
    def unlink(self):
        for language in self:
            if language.code == 'en_US':
                raise UserError(_("Base Language 'en_US' can not be deleted!"))
            ctx_lang = self._context.get('lang')
            if ctx_lang and (language.code == ctx_lang):
                raise UserError(_("You cannot delete the language which is User's Preferred Language!"))
            if language.active:
                raise UserError(_("You cannot delete the language which is Active!\nPlease de-activate the language first."))
            self.env['ir.translation'].search([('lang', '=', language.code)]).unlink()
        self.clear_caches()
        return super(Lang, self).unlink()
    @api.multi
    def format(self, percent, value, grouping=False, monetary=False):