Exact constants in Poincaré type inequalities for functions with zero mean boundary traces