Backport bash security fixes from trunk.