Initial import of Percona patches to the 2.x branch.