rustc: Check for null before dropping ~objects. #5192

r? @tjc

This could probably refactored to more closely mirror the code for @objects, but I'm not inclined to do so.