Should perhaps check that `machine` matches the actual machine.

It's a slight worry that if an entity does `release(machine); release(machine);` then it gets counted twice (despite that entity having only called obtain once). Not sure how much of an issue that will be in the current code. So happy to ignore (but maybe add a TODO comment about it?). Your choice.