(QENG-1225) Move `exit` call into rake task.

The library method should be agnostic to the success or failure statues of its
polling operation.

This commit also attempts to fix the json jankery between ruby 1.8.x and later
versions.

Signed-off-by: Wayne <wayne@puppetlabs.com>