Rivers, Charles, Major Royal Engineers