Use django transactions and select_for_update to prevent race condition in instance_status_history.
	modified:   core/models/instance.py