The 'Session_policy' helper could not cope well with configurations that contain nodes of a type other than '<policy>'. This patch improves the policy matching by skipping non-policy nodes.