Properly show and hide the loading spinner.