Fixed 404 on courseware when users last visited subsection becomes unpublished.

"Page not found" if student visits courseware after the section they visited becomes unpublished.
LMS-6492
@muhammad-ammar is time.sleep() okay in bokchoy tests? are there any other recommendations for this type of scenarios?