Thailand diverts floodwater to save historic structures