abstract file locking in it's own class including a scoped based unlock mechanism