Fixed bug that prevented JSON files from containing the DNS records

When "--json" was specified as the only output option, this output file would not contain the records that were found. This was due to a conditional statement that checked whether there an output file was to be created (csv, xml). However, the JSON output option was not considered in this check, preventing the records from being written to the file.

I've included the JSON output in this check, thus fixing the bug. Furthermore, I've created a variable output_needed, that can be re-used every time this kind of check is needed (instead of checking every output variable every time). Therefore, I was able to replace all the elaborate checks with only the output_needed boolean.