bash: Don't load user32.dll for every shell process
I've discovered that like msys.dll, bash too pulls user32.dll in on every
startup, which slows things down considerably.
It turned out that user32 bits are used in only one place to teach readline how
to paste from Windows clipboard.
Since this stuff is only occasionally used in interactive shells, and not used
at all in non-interactive scripts, let's load user32.dll dynamicaly, only when
needed.
Together with previous patch for msys.dll, this gains significant speedup for
shell scripts:
bash's
configure --help >/dev/null
old: ~2.35s
new: ~1.95s
i.e. 17% improvement.
Under wine the difference is much more dramatic, since loading user32.dll there
is slower:
old: ~56s
new: ~31a
i.e. 44% speedup.
Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>