Fixed segmentation fault on empty spike trains

A simple fix and associated regression test for a segmentation fault that occurred if a passed spike train has no spikes.