I thought the text of" what David did when he fell in need and got hungry, he and the men with him?" could be understood as ..."what David did (alone) when he and the men with him fell in need and got hungry. David would not allow any of his men to assume the risk, only he himself, so he went in alone. (He could have sent someone else)
I Sam 2:20 Ahimelech was the son of Abiathar
II Sam 8:17 Ahimelech was the son of Abiathar
One wonders if this another case, where the righteous son (Ahimelech) does honor to God where the father (Abiathar) did not (very much like Jonathon and Saul. A lot of that going around in those days.) In which case it is good Ahimalech escaped, perhaps David told Ahimelech the truth and warned him about Saul.
One can assume David loaded himself up with bread and took it back to his men.
I couldn't find anything about the showbread being unlawful either, but the account doesn't say it was unlawful by means of the Mosaic Law. Perhaps some additional Jewish law, added on, we all know how that is huh kiddies. (WTB&T anybody)
Life is a roller coaster. Get in, sit down, shut up and hang on!