Captain William KEELING discovered the islands in 1609 , but they remained uninhabited until the 19th century .