Fix: failed result works without 'loss' key

Result dict can now be {'status':STATUS_FAIL}.

If 'loss' is None or is not set, it is interpreted as float('inf') instead
of the default python behavior. The default behavior of the comparison
(None < x), where x is a float, is always true.

This is modified patch from Will Groves responding to github issue #143 with
PR #176.