Python lock-file routines