fix infinite parent folder loop

test plan:
* try to update the name for a root folder of a course
* should give an error, instead of catastrophically
 freezing your server

fixes #CNVS-14868

Change-Id: If0a1c305f3103f3bb7e17ff6ceead7db2e2173de
Reviewed-on: https://gerrit.instructure.com/39512
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>