Replaced all occurrences where the uiManager ends the player's current
ui session one tick before the open inventory is actually closed with
letting the uiManager end the session in the same tick as the inventory
gets closed.
This should fix some duplication bug(s) when player's click a item in
the inventory with shift pressed at least twice before the inventory is
closed (for ex. by left and right clicking at the same time): the first
click gets blocked but the second click gets processed by minecraft like
normal, because we already informed the uiManager that the session is
over.