Guard against empty list
Guard against empty list

Rotating an empty list gives badarith so add a guard clause, since the
result of rotating an empty list is well known.

BugzID: 17801

fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb,fkaempfer/couchdb