Revert "Revert "Got rid of lockfile.""

This reverts commit 0ef10d6f71a698cc6e892bf3c8b931d2451bcb24.