Use a plain ButtonBox instead of a pointer in InputDialog

This fixes a memory leak.