Removed slow LIKE statements

Replaced Like statements with LOCATE, this might be faster on large databases. Needs to be tested
Also I think recursive delete of a file does not delete the file itself, because
SELECT * FROM `*PREFIX*file_map` WHERE `logic_path` = "example.txt"
returns 1 row
whereas
SELECT * FROM `*PREFIX*file_map` WHERE `logic_path` LIKE "example.txt%"
return 0 rows