Fix an error in Collection->random()

Fix an error on random() if called on an empty collection. Returns null instead.
Change syntax of empty check in Collection->random()
Add test to collection->random() when collection is empty
fine, a one liner then.

;)
Merge pull request #5493 from tobz-nz/patch-2

Fix an error in Collection->random()