Fixes race condition

In the case that two dependencies are affecting the same package we'll have to
check for a lock in the install dir. If exists just wait for the other child
processes to finish.