IMCE: Prevent deletion if file is in use
I'm not familiar with IMCE but Drupal core provides a file_usage table that is for locking/unlocking files. These are the functions used to interact with it:

file_usage_add()
file_usage_delete()
file_usage_list()


Drupal's file_delete() then checks the usage table before deleting a file.