A popular sleep medicine has been widely advertised online despite being illegal to buy without a prescription in the UK, according to a Which? investigation.