fix off-by-one in findn and findnz

``count`` was equal to the number of nonzero elements plus one, so the output vectors had an extra element with junk.
add test for #5386
Merge pull request #5386 from mlubin/patch-2

fix off-by-one in findn and findnz