Check connection status before setting scoreboard. Fixes BUKKIT-4064

Two connection status checks were added to setting a scoreboard for a
player. The first checks to see if a player has logged in yet, which
implicates the ability to receive packets. The second checks to affirm
that the CraftPlayer reference is still to a logged in player; setting
it while not logged in would maintain a stale player reference in the
scoreboard manager.

Remapped by Srg2Source from Bukkit/CraftBukkit@98f726e7751d22d3f42b190f75292d878be5fcd6