Added Timeout for Application Lock, Unit tests for Lock model

[test]