escape $md5

If md5sum is not available, the test expression fails with:

+ md5=
+ test = 00000000000000000000000000000000
.sh: line 170: test: =: unary operator expected
ensure all string-like variables are escaped

+ cosmetic changes to have all the test expression consistent