Listview filter: Check if var listview is defined. Fixes #5696 and #5643

The listviewcreate event bubbles up which causes an error if a listview is nested in an UL or OL without data-role="listview".