a file lock implementation using fcntl.flock

Signed-off-by: Gui Chen <gui.chen@intel.com>