First measurement of the bulk flow of nearby galaxies using the cosmic microwave background