Key role of bismuth in the magnetoelastic transitions of Ba3BiIr2O9 and Ba3BiRu2O9 as revealed by chemical doping.