compile_fw: clean and fix content of hash file for latest
This fixes problem with hashes for latest medkit did not match because of name of the file.
This also cleans code all around just a little bit.
Fixes https://gitlab.labs.nic.cz/turris/turris-build/issues/86 for TOS 3.x
Edited by Vojtech Myslivec