Support System.loadLibrary for libraries with transitive dependencies.

Bug: 7896159
Bug: http://code.google.com/p/android/issues/detail?id=34416
Change-Id: Ic0522c4d7c3a3493e09b8dd4f68aabd86acb9b73