Implemented file locking functions (partly based on my old Corel
patch). Added a few regression tests.

12 files changed