dlhist.h: Remove one dlhist_close() prototype.
dlhist.h: Add dlhist_flush() prototype
Makefile: Add distclean target
lockfile: Only add a lock once to the linked list.

remove_from_list() is still there, but should not always be used.
Most of the time, delete from the linked list is unnecessary.
If a struct lockfile's storage is valid throughout the entier life of a program.
And is used (for example) to lock 3 different files in sequence or something.
removing the lockfile from the linked list each time a call to 'commit'
or 'release' is made, and then inserting again on each hold is unnecessary.
Most of the time a lockfile has a longer lifetime than a function's stack frame.

To implement this, a variables is added to the struct to keep track of if
it exists in the list or not. And when calling hold_lock(): insert it if it's not added.

If hover, a lockfile is created in a local function and the caller wishes to
forget about it when leaving the local scope, a separated function with the purpose
of removing the lockfile from the linked list can be implemented, and the caller
should be responsible of calling that function in that case.
lockfile.c: Register signal handlers and atexit on first lockfile to be added to the list.
lockfile.c: Be sure to clear lock filename if lock_open() fails in hold_lock()
lockfile.c: Do not remove O_EXCL when trying to force taking a lock in open_lock()

By making open(2) not fail if the file exists, a race condition can happen.
If 2 processes finds out at the same time that the file exists AND the
file is older than MAX_LOCK_TIME
Both processes will open the file without O_EXCL and both will therefore succeed.

To fix this, use unlink(2) to remove the file first. then a call to open(2) with
O_EXCL flag, open(2) is an atomic operation, and only 1 process will be able to
create the file again and the other process will fail.
lockfile.c: close before rename in commit_lock()

Sometimes, rename fails if the file it is going to rename has active fd's.
lockfile.c: release_lock() always call close() even if unlink() fails.
lockfile.c: minor cleanup.
lockfile.c: reimplement remove_from_list using two pointers.
lockfile.c: remove_from_list: Disable LOCK_ON_LIST flag when removing from list.
lockfile: Add flag for keeping track of if a lock is allocated on the stack or not.
lockfile: add __LOCK_ON_LIST flag to header now that __LOCK_LOCAL_STORAGE is there.