Fixed #16759 -- Remove use of __deepcopy__ in qs.clone()

The original problem was that queryset cloning was really expensive
when filtering with F() clauses. The __deepcopy__ went too deep copying
_meta attributes of the models used. To fix this the use of
__deepcopy__ in qs cloning was removed.

This commit results in some speed improvements across the djangobench
benchmark suite. Most query_* tests are 20-30% faster, save() is 50%
faster and finally complex filtering situations can see 2x to order
of magnitude improvments.

Thanks to Suor, Alex and lrekucki for valuable feedback.
Fixed #16649 -- Refactored save_base logic

When saving an instance that came from the same DB we are saving into
use UPDATE - if not updated - INSERT instead of SELECT - if found
UPDATE - else INSERT. This should save a query in majority of cases,
for example in this case:
  a = SomeModel.objects.get(pk=pkval)
  # change a's fields
  a.save()
Previously a.save() would have done a SELECT - UPDATE, but the SELECT
is redundant as we know from model._state thate we just fetched the
model from the DB. In worst case the update doesn't actually update
anything and we will still correctly do an INSERT.

Also fixed #17341 -- made sure .save() commits transactions only after
the whole model has been saved. This wasn't the case in model
inheritance situations.

The save_base implementation is also refactored into multiple methods.
A typical chain for inherited save would be:
save_base()
    _save_parents(self)
        for each parent:
	    _save_parents(parent)
            _save_table(parent)
    _save_table(self)