Allow getwork result to be a bool or JSON object.

The getwork command alters the output depending on whether or not the
optional data parameter was specified.  It is a JSON object when no data
was provided, and a boolean indicating whether a solution was found
when data was provided.