Avoid unnecessary calls to get_parent_xblock in _course_outline_json

When calculating _course_outline_json's `xblock_studio_url(xblock)` we hit Mongo database often, but mostly because methods used in `xblock_studio_url` (`xblock_has_own_studio_page`, `is_unit`) are calling `get_parent_xblock` a lot. This change tries to reuse information about parent_xblock when possible.

Reduces rendering time for Justice course from 5.5 to 3.2 seconds for me.

review: @cahrens @dan-f
@cahrens updated the code to avoid calling bare `is_unit(parent_xblock)` when possible. Performance gain is still present.