Moved the update_fields existence check into _do_update

Pull request for [Ticket #20272](https://code.djangoproject.com/ticket/20272)