When a petition has been filed in a juvenile court, the minor who is the subject of the petition shall not thereafter be subject to criminal prosecution based on the facts giving rise to the petition unless the juvenile court finds that the minor is not a fit and proper subject to be dealt with under this chapter and orders that criminal proceedings be resumed or instituted against him, or the petition is transferred to a court of criminal jurisdiction pursuant to subdivision (b) of Section 707.01.