Allow creating custom dialogs in DialogPreference.

This allows creating non-AlertDialogs while still using the click and
state handling of DialogPreference.