librbd: fix crash with a chain of flattened images