vzctl set: fix check for changing quotaugidlimit

Commit 4e61f7119 was horribly wrong. First, it did some checks even if
new_res->dq.ugidlimit was not set (i.e. there was no --quotaugidlimit option).
Second, it tried to dereference it which lead for SEGV.

Fix both cases, and moved the code to a separate function for much
better readability.

http://bugzilla.openvz.org/1896

Reported-by: Roman Veretelnikov <roman@rover.pp.ru>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed