Detection of Parameter Direction in DeriveParameters method.

This detection is necessary because currently this methods defaults all
paratemers with Input direction and when using functions that have OUT or
INOUT parameters they aren't updated. This change works for PostgreSQL 8.1
and above.
Added backend server version check, to see whether parameter direction can be obtained from pg_proc table.