Cleared out joint references when destroying joint

Copied relevant part of change from gwtbox2d given by Radek to clear some references with destroyed bodies