A century from Jonny Bairstow helped the England Performance Programme to a four-wicket win over a Western Australia XI at Perth's James Oval.