app: add ref_count check in rtgui_app_exit

If the ref_count reaches 0, don't decrease it.