fix DER encoding of BIT STRING values

Quote (http://luca.ntop.org/Teaching/Appunti/asn1.html):

>  In a primitive encoding, the first contents octet gives the number of bits by which the length of the bit string is less than the next multiple of eight (this is called the "number of unused bits")

This was not followed, leaving wrongly encoded DER (which caused me some headache to debug  till I found this :-) ) 

This PR fixes this (BTW tests are failing for current master?)