QN3D: A three-dimensional quasi-neutral hybrid particle-in-cell code with applications to the tilt mode instability in field reversed configurations