uiomux_mlock/mtrylock/munlock: Add ability to specify a region of iomem to use

This adds three new apis, uiomux_mlock(), uiomux_mtrylock(), and
uiomux_munlock() to specify a region of iomem to use.

uiomux_mlock() shall be similar to uiomux_malloc(), except that this
allows the caller to specify a region of iomem to use. If a specified
region overlaps other locked (used) regions, the calling thread shall
block until the region becomes available.

uiomux_mtrylock() shall be equivalent to uiomux_mlock(), except that
if the specified region is currently locked, the call shall return
immediately.

uiomux_munlock() shall release the region.

These functions could be useful in the following cases.
* To exclude partial regions which shall be used by others, such as
  kernel drivers or (hard-coded) binary blobs, from the iomem region
  managed by uiomux.
* To share a region exclusively between multiple tasks.
Resolve memory leak in uio device enumeration code

The uio device enumeration code, which scans the uio directory using
scandir(), introduced a memory leak. scandir() allocates buffers with
malloc() and the caller is responsible for releasing the buffers,
which was not being done.
This patch removes the scandir() call and simply enumerates the
available uio devices by trying to open each one in sequence.  The
first device to fail will end the enumeration, so there can be no gaps
in the uio device numbering. i.e. uio0 ~ uioN must all be present.
Rearrange mutex locks in uio_mem_find() and uio_mem_alloc()

The two memory operational functions of uio_mem_find() and
uio_mem_alloc() must be performed exclusively and atomically,
otherwise one memory chunk might be assigned for multiple threads
in a process if they invoke uio_mem_find() simultaneously.