core: Batch updates might create a database deadlock

Batch updates might create a database deadlock in systems under load
Sorting the batch collection by id should solve this problem

Change-Id: I1f1868c7a76ea50257f40929573e36ad304c353c
Bug-Url: https://bugzilla.redhat.com/1092299
Signed-off-by: lzelkha@redhat.com <lzelkha@redhat.com>