Added optimistic locking to the admin

This feature prevents data loss in the change pages of the admin. It does so
by:

- Adding a "admin.Lock" model with version number, pk and content type of the
  objects being edited.
- Adding "lock_version" hidden fields to the main object form and inline forms.
- Wrapping the save part of "changeform_view" in a transaction that rolls back
  if a any object on the page has a stale version.
- Showing an error message if the user wasn't allowed to save.