May's deal 'threatens' national security: Ex-spy chief