When I fly, I just assume that any liquid, gel, etc. could find its way outside of its container during the flight. As such, I'm putting in another voice of support for putting the shaving creme in a plastic bag - just in case.
That said, I've never had such problems during air travel.