Merge changes Ic746ea89,Iebaa8063

* changes:
  Wrap all installd operations in lock.
  Mask st_mode before comparing it.