Evan,
Unfortunately it is my experience that ArcMap rarely if ever releases locks on features and tables (regardless of the type of data source) before it is closed. So it's always best to exit ArcMap fully before renaming files that you had opened in ArcMap. Any time you use ArcObjects code to open a file, the handle to the file is going to be controlled from within the "unmanaged" memory space of ArcMap, not in the .NET managed memory space of your Add-in, (hence the need for ReleaseComObject) so there isn't really anything you can ultimately do anything about it. Duncan's code appears to be trying to tell Windows to force ArcMap into releasing unused memory, which might work, but I try to avoid that type of fiddling because it can cause unknown problems. I also wonder if it would even do anything on a 64 bit version of Windows, since it checks to see if the Windows version is Win32NT.
Also, one thing you mentioned was that you were trying to call "ReleaseComObject on the raster layers before exiting the add-in". There aren't any semantics for shutting down the Add-in like that. Once an Add-in is loaded into memory, it pretty much stays there until ArcMap is closed. It might be removed from memory if you uninstalled it, but it doesn't go away just because you close windows, hide toolbars, disable commands and tools, or whatever else you have included in your Add-in. It's still there waiting to be used again. You can put breakpoints on the constructors of your commands and see that they aren't ever called a second time by ArcMap. Thus if you have any static references to your layer, or static references to anything that references the layer, it will still be there until ArcMap is shut down. Just FYI. 😉