Some initial investigations into this reveal that using:
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.01]];
Will cause the webview to finish loading. Also, a second call to it is required after executing a localStorage.setItem() in order for the file__0.localstorage file to be written to disk.
I'll put together a unit test base class using this technique as well as some tests for CDVLocalStorage.