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.