Move all uses of in_bounds(_fully)? over to using cave_in_bounds(_fully) instead.  The assert()s that were triggering in find_safety were because algorithm itself checked against DUNGEON_WID/DUNGEON_HGT (through in_bounds) but the cave code used cave->width and cave->height.