Add guards for unsupported subqueries join plan, optimize the possible subqueriese

Actually, I really need. This originally a bug for this code if set m_JoinValid directly.  Because m_JoinValid variable was remembered for the next access plan.