Added check for pdb writer before trying to emit pdbs

#732