Preferences: Don't crash when opening with null BrowserWindow

Closes #1488
HistoryMenu: Don't crash in aboutToShow() when m_window is null

Closes #1487