MI5 has to terminate £90m IT system over fears for spies’ safety