Australian shares post third straight month of gains; NZ sees best month in nine