JWS: fix instance ToJSON EncodedHeader

Fix an infinite loop in the the toJSON equation for EncodedHeader
and add example from JWS A.5. to the test suite.