document: mention hook_* parameters in new() method.
write.t: add tests about hook_before_write.
Remove _lock() and _unlock() methods, and add _get_lock() method instead. Pass write.t.

The old code had two problems:
1. It cached the SHARYANTO::File::Flock object, so the lock file remained if some hook died.
2. It called SHARYANTO::File::Flock's private methods.

SHARYANTO::File::Flock object removes the lock file when it's get DESTROYed.
The new code takes advantage of this feature to ensure the lock is always removed
when write() is done.