On Clifford's theorem for singular curves