New module filelock.py implementing file locking mechanism