Added assertions to check conditions for exiting while loop

in _raisePermanenceToThreshold method

fixes #1322 
I think we should remove it. The only place I think we should refer to GitHub issues are within `TODO` comment blocks. There's no need to refer from code to the issue tracker for issues that are completed. If the code needs more information, then the necessary comments should be added directly to the code.