Use refactored PackageManager
Relock with shared lock after destructive operation
Factor out the initialization and cleanup to a separate class
Move the locking to Buildroot class