Plausible deniability is an expression - usually used in a legal or political sense - used with reference to speech which implies something (generally negative) but doesn't state it openly and directly, such that the implication can later be denied, having not been stated explicitly.
Plausible deniability
Another example of plausible deniability is someone who actively avoids gaining certain knowledge of facts because it benefits that person not to know.
As an example, a lawyer may suspect that facts exist that would hurt his case but decide not to investigate the issue because if he has actual knowledge, the rules of ethics might require him to reveal the facts to the opposing side.
Although the OP's example is from casual speech, plausible deniability, seems appropriate "when someone implies something without directly saying it, so they can deny they said what they were implying".