Fixed logic flow (out-of-bounds array access if bluetooth is disabled)
Fix memory leak

Closes https://github.com/mate-desktop/mate-user-share/pull/22