(feat) allow blocking flock and timeout for locks

- refactor flock based specs
- move flock logic to dedicated class. 
- allow waiting and timeout