mod. handling lock file removal and checking.

Change-Id: I2cabd6da616cdda40a57aee3891a20d020605a28