Extend nullable pointer optimization to library types