The same has been occuring to me for sometime (6months). I thought it was because i was using Moodle Bitnami, since it was not the same experience on xampp.
I now find the issue to be downloader extension installed on my browser, after using another browser with the same phpmyadmin it stopped auto convertion to .htm and it is now downloading as .sql
This can be a solution to someone out there.