Make uClibc (mostly) compatible with the Chromium setuid sandbox (b/24530000)

When in setuid mode, Chromium needs dlopen() to not call into open(),
close(), etc, as these will fail. It assumes instead that the libc will
cache loaded libraries by libname and return early if they match. This
patch adds that behavior to uClibc. For safety, I deal only with
absolute filepaths, since this avoids any concerns about false-positives
from relative filepaths.

There could still be a false-positive match if you did (pseudo-code);

dlopen("/libfoo.so");
move("/libbar.so", "/libfoo.so"); // overwrite libfoo.so
dlopen("/libfoo.so");

But that fails my three basic checks of:

  1. We have a read-only filesystem so it can't really happen.
  2. It fails under glibc anyway (they cache on filename!)
  3. It's insane, and you shouldn't be doing that.

Change-Id: I77e4c0084f3d669b8134f0e08c9211066dc0ebf2
93 files changed