Don't restore state when popstate event's state is null.

A call to restoreState collapses all expanded files. That conflicts with
commit.expandAllFiles if user has it enabled. This problem is only visible
in Safari and Chrome because only these browsers trigger popstate event on
page load.