Forbid self to self maps
Minor fixes to make Coverity happy.

The logfile API is a bit weird with respect to mutexes.  It's
intended reply with mutexes held
Update logfile API.

We need to close the FP in rlm_detail.  Which means that the
locks on the FD will be closed.  And we don't want to close
the main FD.  So we add a new API to unlock the mutex without
closing the FD.  And we always return a DUP'd FD to the caller,
instead of the main one.

Fixes a whack of Coverity complaints