Cleaned up a lot of duplicate code in the joints

All joints stored a pointer to the Box2D joint, which has now been moved
up to the Box2DJoint base class. As a result the cleanup code and part of
the creation code could be moved up as well.

Some common bugs were fixed in the process:

* Missing 'return' in Box2DDistanceJoint::dampingRatio
* Missing 'return' in Box2DFrictionJoint::localAnchorA
* Missing 'return' in Box2DFrictionJoint::localAnchorB
* Missing 'return' in Box2DPulleyJoint::groundAnchorA
* Missing 'return' in Box2DPulleyJoint::groundAnchorB
* Missing 'return' in Box2DPulleyJoint::localAnchorA
* Missing 'return' in Box2DPulleyJoint::localAnchorB
* Missing y-inversion in Box2DFrictionJoint::localAnchorA
* Missing y-inversion in Box2DFrictionJoint::localAnchorB
* Missing y-inversion in Box2DMotorJoint::linearOffset
* Missing y-inversion in Box2DPrismaticJoint::localAnchorA
* Missing y-inversion in Box2DPrismaticJoint::localAnchorB
* Missing y-inversion in Box2DPulleyJoint::groundAnchorA
* Missing y-inversion in Box2DPulleyJoint::groundAnchorB
* Missing y-inversion in Box2DPulleyJoint::localAnchorA
* Missing y-inversion in Box2DPulleyJoint::localAnchorB
* Missing y-inversion in Box2DRevoluteJoint::localAnchorA
* Missing y-inversion in Box2DRevoluteJoint::localAnchorB
* Missing y-inversion in Box2DRopeJoint::localAnchorA
* Missing y-inversion in Box2DRopeJoint::localAnchorB
* Missing y-inversion in Box2DWheelJoint::localAnchorA
* Missing y-inversion in Box2DWheelJoint::localAnchorB
* Missing y-inversion in Box2DWheelJoint::localAxisA
Fixed crash in World destructor

After the b2World instance has been deleted, Box2DJoint should not still
try to destroy the b2Joint instances. To avoid this the pointers are
nullified when deleting the world.
Fixed FrictionJoint never using automatic anchors