Fix fetch results to handle errors

The fetch result now checks for success rather than error. The number
of attempts to fetch the result is an argument rather than a global
variable.

	modified:   web/js/synfind.js