Unpurchased items in the shoppingcart should be removed if the enrollment period has closed

@afzaledx 
@chrisndodge Kindly review the changes for WL-164.

Thanks
safer to check explicitly `if course_key is not None`