Avoid stack overflow

PE files can contain loops in the resources structure causing stack overflows while calling _pe_iterate_resources recursively.