Improve garbage collection order and add test
Requires libfprint!231 (merged) to be merged (test runs against it).
Note that the test currently fails because it expects a specific garbage collection order. However, we are currently deleting pretty much at random.
Edited by Benjamin Berg