Detection of Parameter Direction in DeriveParameters method.

This detection is necessary because currently this method defaults all parameters 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.