The nature of dark matter from the global high-redshift H I 21 cm signal