[Bug 373165] implement finer grained locking mechanism for package management