make lockd.py more robust