Three dead, thousands affected after floodwaters swamp New South Wales