WL-3092 Initialise `expandedFolders` if it is `null`

We've had a bug in the wild [1] from an NPE in `ListItem`, which resulted
from calling `getListItem` when producing the list of resources without
first setting up `expandedFolders`.

I believe it's normally pulled out of the session state so perhaps this
was the result of a  session timeout. Either way it's an easy fix and
makes the code better.

[1] http://sentry.oucs.ox.ac.uk/weblearn/weblearn-live/group/130762/