Improve the error message when failing to lock a package