Commit fast-build patch to portage_tool repository.

This patch allows us to selectively disable Portage locks in parallel_emerge.
It is not intended to be upstreamed but is left in for now until we find a way
to replace it (e.g. by integrating parallel emerge support directly into portage
itself).

Note- imported directly from patch, original metadata/sha1 lost

BUG=chromium-os:11324
TEST=build_packages --nousepkg

Review URL: http://codereview.chromium.org/6377009
Review URL: https://gerrit.chromium.org/gerrit/42996

Change-Id: I8ceb0a2ca4103162f7380dd7b8b839cfd323d248
Reviewed-on: https://chromium-review.googlesource.com/214524
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Tested-by: Bertrand Simonnet <bsimonnet@chromium.org>
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 764cbff..a35d9f6 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -215,7 +215,7 @@
 		"""
 		if self._lock_count:
 			self._lock_count += 1
-		else:
+		elif os.environ.get("PORTAGE_LOCKS") != "false":
 			if self._lock is not None:
 				raise AssertionError("already locked")
 			# At least the parent needs to exist for the lock file.
@@ -231,7 +231,7 @@
 		"""
 		if self._lock_count > 1:
 			self._lock_count -= 1
-		else:
+		elif os.environ.get("PORTAGE_LOCKS") != "false":
 			if self._lock is None:
 				raise AssertionError("not locked")
 			self._lock_count = 0