Fix bug introduced when functions new_object() and session_object_exists().

The boolean variable is_object_new was not set and handled correctly.