common: New function dotlock_is_locked.
* common/dotlock.c (dotlock_is_locked): New. (dotlock_take): Set locked flag also in disabled mode. No more warning if the lock has already been taken. (dotlock_release): Clear locked flag also in disabled mode. No more warning if the lock has not been taken.
This allow to use dotlock_take and dotlock_release even if they have
already been called. Before this changes this worked too but a
diagnostic was printed.