The novel provides another key detail: Sollozzo had a man in the restaurant at another table. When Michael asked to go to the john, Sollozzo looked to the man, who gave him a sign that it was ok because he had checked the bathroom. That's probably why Sollozzo didn't search Michael when he came out.