"Pills" was also a semi-euphemism for "Balls" in my schooldays {& rugby players will [hence?] sometimes refer to the ball facetiously as 'the pill'}: & 'balls' in its turn a sort of shortened form of 'bollocks' [or perhaps conversely 'bollocks', or 'ballocks' (both spellings acceptable?), originally a diminutive of 'balls'?]. So perhaps 'pillock' - as well as probable but surely not definitive relationship to 'pillicock' - a facetious semi-derivative euphemism for 'bollock'.
As all of these are likely to be oral-tradition words long before recorded, it is pretty well impossible to establish which form will have preceded which...