libutee: fix TA_CreateEntryPoint() and TA_DestroyEntryPoint()
libutee: fix TA_CreateEntryPoint() and TA_DestroyEntryPoint()

Fixes issues observed with keep alive single instance TAs:
- TA_CreateEntryPoint() must only be called once,
- TA_DestroyEntryPoint() must not be called when the last session is
closed, because the instance is still alive.

While we're at it, simplify the code a bit by not using a separate
variable (ta_ref_count) to track whether we have sessions or not.
Simply use TAILQ_EMPTY() on the session queue instead.

Signed-off-by: Jerome Forissier <ced78d268b4c9a0a20a59a9feeebd2ad90da03d3@linaro.org>
Reviewed-by: Jens Wiklander <7706914404370d7502c27a0eff493dcf491feb51@linaro.org>
Acked-by: Kevin Peng <7cba9ad118f8345427678affdec63c06c7f3b30d@marvell.com>
Reviewed-by: Etienne Carriere <f21bc5b8f3ea1962eb45af359f1abea6578cab94@linaro.org>

pascal-brand-st-dev/optee_os,pascal-brand-st-dev/optee_os,pascal-brand-st-dev/optee_os,pascal-brand-st-dev/optee_os,pascal-brand-st-dev/optee_os