server: remove existing file if hash exists

If uploading a file with the same hash (very likely same contents)
but a different filename, multiple copies of that file will be kept
around. Added a check to remove the existing file before adding the new
one.