Accept subtypes for function results, type casts

Patch by Tyler Hobbs; reviewed by Sylvain Lebresne for CASSANDRA-6766