Nice catch. But is the second one actually a bug? If you have permissions to delete a file at the point you have acquired the inode, you are entitled to do it (whether or not the file has changed).
One possible solution is to pass the file name to the acquire function and check the name before locking the inode. However, if the new file is created by the same name, then the problem will persist.
Certain integrity requirements are hard to do even at the kernel level, and will have to be handled at the application programmer. That is why the design of co-operating concurrent applications turns out to be pretty tricky.