MT#7377 API: better check for JSON::Types::bool.

Sometimes the value is a ref to some other var, so a simple
if($foo){} is not sufficient, as it would be true, althouhg we're
just checking if it's defined and has a value.