Limits on the flux of tau neutrinos from 1 PeV to 3 EeV with the MAGIC telescopes