core: making sure not throw NPE when opening SPICE console

When processing console request we get username from db and perform
contains and substring on it. We did not check whether the name is null.
This patch introduces this check.

Bug-Url: https://bugzilla.redhat.com/1120692
Change-Id: Idd5f4a33f8fc5c41faead26afd7ce91c2412ac16
Signed-off-by: pkliczewski <piotr.kliczewski@gmail.com>