Group duplicate files (part 3)
hash_next_n_bytes can return None in case of EOF
You close the remaining files at the end of group_duplicate_files, but you just del file_handle_map[f] in the while loop. You don't have to close the files, their __del__ method will take care of it when the function returns.
Instead of


while True:
    terminate = True
    ...
    if terminate:
        break


you can do


terminate = False
while not terminate:
    terminate = True
    ...

No need to make file_handle_map a defaultdict, it can be just dict.




Some optimization suggestions:


You can initialize the hash with sizes of files. That way, you will avoid comparing large files with many common leading bytes.
It might just be faster to calculate some simple checksum (MD5 or so) of a larger portion of the file. Alternately reading 10 bytes from many different files and calling hash on each result will likely be inefficient.