uClibc: backport useful fixes from trunk (#12777)