Fix ALTER SCHEMA bug when renaming dependent objects

This fixes a segmentation fault, strangely this is correctly done in
REL1_1_STABLE and master.

Noticed by Andrei Martsinchyk