Former D.A. Bruce Castor reveals Bill Cosby's "non-prosecution agreement" was in writing