Fix endian bug in length encoding

For non-UTF-8 string pools, ENCODE_LENGTH will encode the
length as a series of uint16_t:s.  However, it does not
perform endian swapping, so if the byte order of the host
and device differs, this has to be fixed up afterwards.
Fix wordlength bug in ResTable::parsePackage

The package header field "size" is 32 bits, not 16.  Therefore,
the function dtohl(), not dtohs(), needs to be used to convert
it to host byteorder.
Add a missing dtohl() in ResTable::identifierForName

The typeSpecFlags array in Type objects contain device endian
data, so it needs to be converted to host endianness before use.