Bam Margera agrees to plea deal as trial was about to begin in Chester County