project: Fix a integrity violation while deleting.

This exception is caused by refering Project from CodeComment.