Gitmo detainee agrees to plea deal at military tribunal