fixed recent bug with sorting atoms for GPUs

The sort buffer in the nbnxn gridding for GPUs was made too small
in 8d6cc146. This led to inconsistency errors (not incorrect output).
This is fixed and the sort_atoms call is now made simpler and
multiple consistency checks are now always on in debug builds.
Fixes #1153

Change-Id: Ifcdf45bb4de88e7584628d3ed2699e2fd469d5c6