On De-serialization, the transient variable lock is null

On De-serialization, the transient variable lock get its Default value ie null. 
- make sure that the lock is not null; if it is. initialise it