tasks/memusage: Many fixes

Okay, so the random timeout values which worked on my laptop
don't on the build server, shockingly enough.

We now use a wrapper script that tells gnome-shell to exit cleanly, so
the massifs logs make it to disk.  We wait for it to exit, and then do
a full "sync" so that the file actually makes to the "disk".