info: use macros to check types

Use the macros to check the type of objects instead of directly poking
at the first field.
info: GstDateTime does not have a GType as first field

GstDateTime does not have the GType as the first field so we can't use
it to detect its type.
info: first handle all miniobjects, then GObjects

First handle all miniobjects before we attempt to dereference the first
field pointer and look at the GType. With the recent glib change to
speed up G_IS_OBJECT, this causes crashes on miniobjects otherwise.
downloadbuffer: reset read and write positions

Reset the read and write positions right after we open the file or flush
it. We are also in the buffering state with 0 percent buffered when we
start.
identity: fix potential buffer overflow

Coverity 1037155
identity: add static and const where appropriate