Crash when navigating back with "RefCell is already borrowed"

This fixes two `RefCell<T> is already borrowed` failures when reloading an
existing pipeline, both caused by functions trying to modify `Pipeline::url`
or `ScriptTask::url` while a reference to a previous borrow is still in scope.

Note: After applying this patch, there are some painting issues after navigating back.